3 test_description
='ask merge-recursive to merge binary files'
5 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
=main
6 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
8 TEST_PASSES_SANITIZE_LEAK
=true
11 test_expect_success setup
'
13 cat "$TEST_DIRECTORY"/test-binary-1.png >m &&
15 git ls-files -s | sed -e "s/ 0 / 1 /" >E1 &&
17 git commit -m "initial" &&
24 git ls-files -s a >E0 &&
25 git ls-files -s m | sed -e "s/ 0 / 3 /" >E3 &&
27 git commit -m "main adds some" &&
32 git ls-files -s m | sed -e "s/ 0 / 2 /" >E2 &&
34 git commit -m "side modifies" &&
38 cat E0 E1 E2 E3 >expect
41 test_expect_success resolve
'
44 git reset --hard anchor &&
46 if git merge -s resolve main
48 echo Oops, should not have succeeded
51 git ls-files -s >current &&
52 test_cmp expect current
56 test_expect_success recursive
'
59 git reset --hard anchor &&
61 if git merge -s recursive main
63 echo Oops, should not have succeeded
66 git ls-files -s >current &&
67 test_cmp expect current