From: Ramkumar Ramachandra Date: Mon, 13 May 2013 12:45:54 GMT Subject: [PATCH 6/6] rebase: use 'git stash store' to simplify logic Message-ID: <1368449154-21882-7-git-send-email-artagnon@gmail.com> In-Reply-To: <1368449154-21882-1-git-send-email-artagnon@gmail.com> rebase has no reason to know about the implementation of the stash. In the case when applying the autostash results in conflicts, replace the relevant code in finish_rebase () to simply call 'git stash store'. Signed-off-by: Ramkumar Ramachandra --- git-rebase.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/git-rebase.sh b/git-rebase.sh index f4a3a26..7c82f95 100755 --- a/git-rebase.sh +++ b/git-rebase.sh @@ -153,11 +153,7 @@ finish_rebase () { then gettext "Applied autostash." else - ref_stash=refs/stash && - : >>"$GIT_DIR/logs/$ref_stash" && - git update-ref -m "autostash" $ref_stash $stash_sha1 || - die "$(eval_gettext 'Cannot store $stash_sha1')" - + git stash store $stash_sha1 "autostash" && gettext 'Applying autostash resulted in conflicts. Your changes are safe in the stash. You can run "git stash pop" or "git stash drop" at any time. -- 1.8.3.rc1.57.g4ac1522