]> git.ipfire.org Git - thirdparty/git.git/commitdiff
sequencer: unlink autostash in apply_autostash()
authorDenton Liu <liu.denton@gmail.com>
Tue, 7 Apr 2020 14:28:04 +0000 (10:28 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 10 Apr 2020 16:28:02 +0000 (09:28 -0700)
Explicitly remove autostash file in apply_autostash() once it has been
applied successfully.

This is currently a no-op because the only users of this function will unlink
the state (including the autostash file) after this function runs.
However, in the future, we will introduce a user of the function that
does not explicitly remove the state so we do it here.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sequencer.c

index e0b8262521e18b551e6541997de2ad4dabceb084..645bc47ce3c0e9cc080c6bd0aa56e3cd314e9508 100644 (file)
@@ -3748,6 +3748,7 @@ int apply_autostash(const char *path)
                                  " \"git stash drop\" at any time.\n"));
        }
 
+       unlink(path);
        strbuf_release(&stash_oid);
        return ret;
 }