diff options
author | Elijah Newren <newren@gmail.com> | 2011-08-11 23:20:04 -0600 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-08-14 14:19:37 -0700 |
commit | 0a6b87126e6a4e2649f6da23db67eeaad11d102e (patch) | |
tree | 032427c161ac3445f35ec8426a48a5bd163b7cbc /t/t6036-recursive-corner-cases.sh | |
parent | 531357a4cc2b93ec68099890b835f50e462ceab7 (diff) | |
download | git-0a6b87126e6a4e2649f6da23db67eeaad11d102e.tar.gz |
merge-recursive: Make dead code for rename/rename(2to1) conflicts undead
The code for rename_rename_2to1 conflicts (two files both being renamed to
the same filename) was dead since the rename/add path was always being
independently triggered for each of the renames instead. Further,
reviving the dead code showed that it was inherently buggy and would
always segfault -- among a few other bugs.
Move the else-if branch for the rename/rename block before the rename/add
block to make sure it is checked first, and fix up the rename/rename(2to1)
code segments to make it handle most cases. Work is still needed to
handle higher dimensional corner cases such as rename/rename/modify/modify
issues.
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6036-recursive-corner-cases.sh')
-rwxr-xr-x | t/t6036-recursive-corner-cases.sh | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/t/t6036-recursive-corner-cases.sh b/t/t6036-recursive-corner-cases.sh index 279f33ca2d..b046e1be71 100755 --- a/t/t6036-recursive-corner-cases.sh +++ b/t/t6036-recursive-corner-cases.sh @@ -66,13 +66,13 @@ test_expect_success 'merge simple rename+criss-cross with no modifications' ' test $(git rev-parse :2:three) = $(git rev-parse L2:three) && test $(git rev-parse :3:three) = $(git rev-parse R2:three) && - cp two merged && + cp one merged && >empty && test_must_fail git merge-file \ - -L "Temporary merge branch 2" \ - -L "" \ -L "Temporary merge branch 1" \ - merged empty one && + -L "" \ + -L "Temporary merge branch 2" \ + merged empty two && test $(git rev-parse :1:three) = $(git hash-object merged) ' @@ -145,11 +145,12 @@ test_expect_success 'merge criss-cross + rename merges with basic modification' cp one merge-me && >empty && test_must_fail git merge-file \ - -L "Temporary merge branch 2" \ - -L "" \ -L "Temporary merge branch 1" \ - merged empty merge-me && - test $(git rev-parse :1:three) = $(git hash-object merged) + -L "" \ + -L "Temporary merge branch 2" \ + merge-me empty merged && + + test $(git rev-parse :1:three) = $(git hash-object merge-me) ' # |