Skip to content

Commit 1cd1292

Browse files
hashplinggitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6589ebf commit 1cd1292

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

t/t6023-merge-file.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ deduxit me super semitas jusitiae,
5454
EOF
5555
printf "propter nomen suum." >> new4.txt
5656

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+
5763
cp new1.txt test.txt
5864
test_expect_success "merge without conflict" \
5965
"git merge-file test.txt orig.txt new2.txt"

0 commit comments

Comments
 (0)