summaryrefslogtreecommitdiff
path: root/git-rebase.sh
diff options
context:
space:
mode:
authorRamkumar Ramachandra <artagnon@gmail.com>2013-06-15 18:43:26 +0530
committerJunio C Hamano <gitster@pobox.com>2013-06-17 11:43:24 -0700
commit20351bb06bf4d32ef3d1a6849d01636f6593339f (patch)
treefc2a9dfa4f36024319ab6497c05a74b27f50ca5c /git-rebase.sh
parentbd514cada4bb1a396a58d408c3ec08526a8be742 (diff)
downloadgit-20351bb06bf4d32ef3d1a6849d01636f6593339f.tar.gz
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>
Diffstat (limited to 'git-rebase.sh')
-rwxr-xr-xgit-rebase.sh7
1 files changed, 2 insertions, 5 deletions
diff --git a/git-rebase.sh b/git-rebase.sh
index d0c11a910a..17be3922f8 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -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.