Skip to content

Commit

Permalink
rebase: use 'git stash store' to simplify logic
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ramkumar Ramachandra authored and Junio C Hamano committed Jun 17, 2013
1 parent bd514ca commit 20351bb
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions git-rebase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,8 @@ finish_rebase () {
then
echo "$(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 -m "autostash" -q $stash_sha1 ||
die "$(eval_gettext "Cannot store \$stash_sha1")"
gettext 'Applying autostash resulted in conflicts.
Your changes are safe in the stash.
You can run "git stash pop" or "git stash drop" it at any time.
Expand Down

0 comments on commit 20351bb

Please sign in to comment.