From 33ba9c648b6753a4184e53ffb89f0a924f9f7b7e Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Wed, 29 Jun 2016 08:21:27 +0200 Subject: rebase -i: restore autostash on abort When we abort an interactive rebase we do so by calling `die_abort`, which cleans up after us by removing the rebase state directory. If the user has requested to use the autostash feature, though, the state directory may also contain a reference to the autostash, which will now be deleted. Fix the issue by trying to re-apply the autostash in `die_abort`. This will also handle the case where the autostash does not apply cleanly anymore by recording it in a user-visible stash. Reported-by: Daniel Hahler Signed-off-by: Patrick Steinhardt Signed-off-by: Junio C Hamano --- git-rebase--interactive.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'git-rebase--interactive.sh') diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index b938a6d4a..8fe7a7015 100644 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@ -216,6 +216,7 @@ exit_with_patch () { } die_abort () { + apply_autostash rm -rf "$state_dir" die "$1" } -- cgit v1.2.1