diff options
Diffstat (limited to 't/t6406-merge-attr.sh')
-rwxr-xr-x | t/t6406-merge-attr.sh | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/t/t6406-merge-attr.sh b/t/t6406-merge-attr.sh index d5a4ac2d81..57e6af5eaa 100755 --- a/t/t6406-merge-attr.sh +++ b/t/t6406-merge-attr.sh @@ -62,10 +62,10 @@ test_expect_success setup ' test_expect_success merge ' - { - echo "binary -merge" - echo "union merge=union" - } >.gitattributes && + cat >.gitattributes <<-\EOF && + binary -merge + union merge=union + EOF if git merge main then @@ -207,4 +207,22 @@ test_expect_success 'custom merge does not lock index' ' git merge main ' +test_expect_success 'binary files with union attribute' ' + git checkout -b bin-main && + printf "base\0" >bin.txt && + echo "bin.txt merge=union" >.gitattributes && + git add bin.txt .gitattributes && + git commit -m base && + + printf "one\0" >bin.txt && + git commit -am one && + + git checkout -b bin-side HEAD^ && + printf "two\0" >bin.txt && + git commit -am two && + + test_must_fail git merge bin-main 2>stderr && + grep -i "warning.*cannot merge.*HEAD vs. bin-main" stderr +' + test_done |