]> git.ipfire.org Git - thirdparty/git.git/commitdiff
rebase (autostash): avoid duplicate call to state_dir_path()
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Mon, 22 Oct 2018 22:15:02 +0000 (15:15 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 23 Oct 2018 04:17:08 +0000 (13:17 +0900)
We already called that function at this point, and stored the result in
the `path` variable. We might just as well use it ;-)

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Reviewed-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/rebase.c

index 9dc8475cd361af2ad712f4f53df3453df5f9bd45..42f320453a81c3c2d375bba160aac0e62539298e 100644 (file)
@@ -250,7 +250,7 @@ static int apply_autostash(struct rebase_options *opts)
        if (!file_exists(path))
                return 0;
 
-       if (read_one(state_dir_path("autostash", opts), &autostash))
+       if (read_one(path, &autostash))
                return error(_("Could not read '%s'"), path);
        argv_array_pushl(&stash_apply.args,
                         "stash", "apply", autostash.buf, NULL);