@@ -55,6 +55,16 @@ test_expect_success 'setup' '
55
55
git rm file12 &&
56
56
git commit -m "branch1 changes" &&
57
57
58
+ git checkout -b stash1 master &&
59
+ echo stash1 change file11 >file11 &&
60
+ git add file11 &&
61
+ git commit -m "stash1 changes" &&
62
+
63
+ git checkout -b stash2 master &&
64
+ echo stash2 change file11 >file11 &&
65
+ git add file11 &&
66
+ git commit -m "stash2 changes" &&
67
+
58
68
git checkout master &&
59
69
git submodule update -N &&
60
70
echo master updated >file1 &&
@@ -193,7 +203,35 @@ test_expect_success 'mergetool skips resolved paths when rerere is active' '
193
203
git reset --hard
194
204
'
195
205
206
+ test_expect_success ' conflicted stash sets up rerere' '
207
+ git config rerere.enabled true &&
208
+ git checkout stash1 &&
209
+ echo "Conflicting stash content" >file11 &&
210
+ git stash &&
211
+
212
+ git checkout --detach stash2 &&
213
+ test_must_fail git stash apply &&
214
+
215
+ test -n "$(git ls-files -u)" &&
216
+ conflicts="$(git rerere remaining)" &&
217
+ test "$conflicts" = "file11" &&
218
+ output="$(git mergetool --no-prompt)" &&
219
+ test "$output" != "No files need merging" &&
220
+
221
+ git commit -am "save the stash resolution" &&
222
+
223
+ git reset --hard stash2 &&
224
+ test_must_fail git stash apply &&
225
+
226
+ test -n "$(git ls-files -u)" &&
227
+ conflicts="$(git rerere remaining)" &&
228
+ test -z "$conflicts" &&
229
+ output="$(git mergetool --no-prompt)" &&
230
+ test "$output" = "No files need merging"
231
+ '
232
+
196
233
test_expect_success ' mergetool takes partial path' '
234
+ git reset --hard
197
235
git config rerere.enabled false &&
198
236
git checkout -b test12 branch1 &&
199
237
git submodule update -N &&
0 commit comments