Skip to content

Commit

Permalink
t6023: merge-file fails to output anything for a degenerate merge
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
hashpling authored and gitster committed May 25, 2009
1 parent 6589ebf commit 1cd1292
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions t/t6023-merge-file.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ deduxit me super semitas jusitiae,
EOF
printf "propter nomen suum." >> new4.txt

test_expect_failure 'merge with no changes' '
cp orig.txt test.txt &&
git merge-file test.txt orig.txt orig.txt &&
test_cmp test.txt orig.txt
'

cp new1.txt test.txt
test_expect_success "merge without conflict" \
"git merge-file test.txt orig.txt new2.txt"
Expand Down

0 comments on commit 1cd1292

Please sign in to comment.