Skip to content

Commit 743bf6d

Browse files
phordgitster
authored andcommitted
stash: invoke rerere in case of conflict
"stash apply" directly calls a backend merge function which does not automatically invoke rerere. This confuses mergetool when leftover rerere state is left behind from previous merges. Invoke rerere explicitly when we encounter a conflict during stash apply. This turns the test introduced by the previous commit to succeed. Signed-off-by: Phil Hord <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 79dc2d0 commit 743bf6d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

git-stash.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,7 @@ apply_stash () {
469469
else
470470
# Merge conflict; keep the exit status from merge-recursive
471471
status=$?
472+
git rerere
472473
if test -n "$INDEX_OPTION"
473474
then
474475
gettextln "Index was not unstashed." >&2

t/t7610-mergetool.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ test_expect_success 'mergetool skips resolved paths when rerere is active' '
203203
git reset --hard
204204
'
205205

206-
test_expect_failure 'conflicted stash sets up rerere' '
206+
test_expect_success 'conflicted stash sets up rerere' '
207207
git config rerere.enabled true &&
208208
git checkout stash1 &&
209209
echo "Conflicting stash content" >file11 &&

0 commit comments

Comments
 (0)