@matheusbsbs / matheus-bagliano / commits / 1cd12926ce
Fork 0

t6023: merge-file fails to output anything for a degenerate merge

In the case that merge-file is passed three files with identical contents it wipes the contents of the output file instead of leaving it unchanged. Althought merge-file is porcelain and this will never happen in normal usage, it is still wrong. Signed-off-by: Charles Bailey <charles@hashpling.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Charles Bailey committed May 25, 2009 at 01:21 UTC 1cd12926cedb340d176db607e087495381032ce2
1 file changed +6
t/t6023-merge-file.sh
+6
@@ -54,6 +54,12 @@ deduxit me super semitas jusitiae,
54 EOF
55 printf "propter nomen suum." >> new4.txt
56
57 +test_expect_failure 'merge with no changes' '
58 + cp orig.txt test.txt &&
59 + git merge-file test.txt orig.txt orig.txt &&
60 + test_cmp test.txt orig.txt
61 +'
62 +
63 cp new1.txt test.txt
64 test_expect_success "merge without conflict" \
65 "git merge-file test.txt orig.txt new2.txt"