Skip to content

Commit 20351bb

Browse files
artagnongitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent bd514ca commit 20351bb

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

git-rebase.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,8 @@ finish_rebase () {
153153
then
154154
echo "$(gettext 'Applied autostash.')"
155155
else
156-
ref_stash=refs/stash &&
157-
>>"$GIT_DIR/logs/$ref_stash" &&
158-
git update-ref -m "autostash" $ref_stash $stash_sha1 ||
159-
die "$(eval_gettext 'Cannot store $stash_sha1')"
160-
156+
git stash store -m "autostash" -q $stash_sha1 ||
157+
die "$(eval_gettext "Cannot store \$stash_sha1")"
161158
gettext 'Applying autostash resulted in conflicts.
162159
Your changes are safe in the stash.
163160
You can run "git stash pop" or "git stash drop" it at any time.

0 commit comments

Comments
 (0)