diff options
author | Elijah Newren <newren@gmail.com> | 2011-08-11 23:20:06 -0600 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-08-14 14:19:37 -0700 |
commit | 51931bf08e7de1f597d36bc2fd38b5310b6da7dd (patch) | |
tree | 1b3bc720ea90fe1bbc4609de02c680f02a0134d9 /t | |
parent | merge-recursive: Add comments about handling rename/add-source cases (diff) | |
download | tgif-51931bf08e7de1f597d36bc2fd38b5310b6da7dd.tar.xz |
merge-recursive: Improve handling of rename target vs. directory addition
When dealing with file merging and renames and D/F conflicts and possible
criss-cross merges (how's that for a corner case?), we did not do a
thorough job ensuring the index and working directory had the correct
contents. Fix the logic in merge_content() to handle this. Also,
correct some erroneous tests in t6022 that were expecting the wrong number
of unmerged index entries. These changes fix one of the tests in t6042
(and almost fix another one from t6042 as well).
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t6022-merge-rename.sh | 4 | ||||
-rwxr-xr-x | t/t6042-merge-rename-corner-cases.sh | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/t/t6022-merge-rename.sh b/t/t6022-merge-rename.sh index 6ff4bd26ad..fcc1d4cfff 100755 --- a/t/t6022-merge-rename.sh +++ b/t/t6022-merge-rename.sh @@ -307,7 +307,7 @@ test_expect_success 'Rename+D/F conflict; renamed file merges but dir in way' ' grep "Auto-merging dir" output && grep "Adding as dir~HEAD instead" output && - test 2 -eq "$(git ls-files -u | wc -l)" && + test 3 -eq "$(git ls-files -u | wc -l)" && test 2 -eq "$(git ls-files -u dir/file-in-the-way | wc -l)" && test_must_fail git diff --quiet && @@ -329,7 +329,7 @@ test_expect_success 'Same as previous, but merged other way' ' grep "Auto-merging dir" output && grep "Adding as dir~renamed-file-has-no-conflicts instead" output && - test 2 -eq "$(git ls-files -u | wc -l)" && + test 3 -eq "$(git ls-files -u | wc -l)" && test 2 -eq "$(git ls-files -u dir/file-in-the-way | wc -l)" && test_must_fail git diff --quiet && diff --git a/t/t6042-merge-rename-corner-cases.sh b/t/t6042-merge-rename-corner-cases.sh index 668ec6d498..968055d47c 100755 --- a/t/t6042-merge-rename-corner-cases.sh +++ b/t/t6042-merge-rename-corner-cases.sh @@ -234,7 +234,7 @@ test_expect_success 'setup content merge + rename/directory conflict' ' git commit -m left ' -test_expect_failure 'rename/directory conflict + clean content merge' ' +test_expect_success 'rename/directory conflict + clean content merge' ' git reset --hard && git reset --hard && git clean -fdqx && |