Browse Source

rebase: use 'git stash store' to simplify logic

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 <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Ramkumar Ramachandra 12 years ago committed by Junio C Hamano
parent
commit
20351bb06b
  1. 7
      git-rebase.sh

7
git-rebase.sh

@ -153,11 +153,8 @@ finish_rebase () {
then then
echo "$(gettext 'Applied autostash.')" echo "$(gettext 'Applied autostash.')"
else else
ref_stash=refs/stash && git stash store -m "autostash" -q $stash_sha1 ||
>>"$GIT_DIR/logs/$ref_stash" && die "$(eval_gettext "Cannot store \$stash_sha1")"
git update-ref -m "autostash" $ref_stash $stash_sha1 ||
die "$(eval_gettext 'Cannot store $stash_sha1')"

gettext 'Applying autostash resulted in conflicts. gettext 'Applying autostash resulted in conflicts.
Your changes are safe in the stash. Your changes are safe in the stash.
You can run "git stash pop" or "git stash drop" it at any time. You can run "git stash pop" or "git stash drop" it at any time.

Loading…
Cancel
Save