Browse Source

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>
maint
Charles Bailey 16 years ago committed by Junio C Hamano
parent
commit
1cd12926ce
  1. 6
      t/t6023-merge-file.sh

6
t/t6023-merge-file.sh

@ -54,6 +54,12 @@ deduxit me super semitas jusitiae, @@ -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"

Loading…
Cancel
Save