diff mbox series

[v5,17/22] sequencer: unlink autostash in apply_autostash()

Message ID 129d5d97aefdc5b75046f0b9051c5fe9378f54ac.1586269543.git.liu.denton@gmail.com (mailing list archive)
State New, archived
Headers show
Series merge: learn --autostash | expand

Commit Message

Denton Liu April 7, 2020, 2:28 p.m. UTC
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>
---
 sequencer.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/sequencer.c b/sequencer.c
index e0b8262521..645bc47ce3 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -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;
 }