From 9b2df3e8d093145f1628af82b94f6dcfc85b9646 Mon Sep 17 00:00:00 2001 From: Denton Liu Date: Tue, 28 Apr 2020 05:31:31 -0400 Subject: rebase: save autostash entry into stash reflog on --quit In a03b55530a (merge: teach --autostash option, 2020-04-07), the --autostash option was introduced for `git merge`. Notably, when `git merge --quit` is run with an autostash entry present, it is saved into the stash reflog. This is contrasted with the current behaviour of `git rebase --quit` where the autostash entry is simply just dropped out of existence. Adopt the behaviour of `git merge --quit` in `git rebase --quit` and save the autostash entry into the stash reflog instead of just deleting it. Signed-off-by: Denton Liu Signed-off-by: Junio C Hamano --- builtin/rebase.c | 1 + 1 file changed, 1 insertion(+) (limited to 'builtin') diff --git a/builtin/rebase.c b/builtin/rebase.c index bc4fc69906..71aec532b1 100644 --- a/builtin/rebase.c +++ b/builtin/rebase.c @@ -1556,6 +1556,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix) goto cleanup; } case ACTION_QUIT: { + save_autostash(state_dir_path("autostash", &options)); if (options.type == REBASE_MERGE) { struct replay_opts replay = REPLAY_OPTS_INIT; -- cgit v1.3