File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -333,6 +333,19 @@ test_expect_failure 'file/submodule conflict' '
333333 )
334334'
335335
336+ test_expect_success ' file/submodule conflict; merge --abort works afterward' '
337+ test_when_finished "git -C file-submodule reset --hard" &&
338+ (
339+ cd file-submodule &&
340+
341+ git checkout A^0 &&
342+ test_must_fail git merge B^0 >out 2>err &&
343+
344+ test_path_is_file .git/MERGE_HEAD &&
345+ git merge --abort
346+ )
347+ '
348+
336349# Directory/submodule conflict
337350# Commit O: <empty>
338351# Commit A: path (submodule), with sole tracked file named 'world'
@@ -417,7 +430,25 @@ test_expect_failure 'directory/submodule conflict; should not treat submodule fi
417430 # merge from starting; we should not be writing to such paths
418431 # anyway.
419432 test_i18ngrep ! "refusing to lose untracked file at" err
433+ )
434+ '
435+
436+ test_expect_failure ' directory/submodule conflict; merge --abort works afterward' '
437+ test_when_finished "git -C directory-submodule/path reset --hard" &&
438+ test_when_finished "git -C directory-submodule reset --hard" &&
439+ (
440+ cd directory-submodule &&
420441
442+ git checkout A^0 &&
443+ test_must_fail git merge B2^0 &&
444+ test_path_is_file .git/MERGE_HEAD &&
445+
446+ # merge --abort should succeed, should clear .git/MERGE_HEAD,
447+ # and should not leave behind any conflicted files
448+ git merge --abort &&
449+ test_path_is_missing .git/MERGE_HEAD &&
450+ git ls-files -u >conflicts &&
451+ test_must_be_empty conflicts
421452 )
422453'
423454
You can’t perform that action at this time.
0 commit comments