]> git.ipfire.org Git - thirdparty/git.git/blame - t/t6407-merge-binary.sh
Merge branch 'en/fetch-negotiation-default-fix'
[thirdparty/git.git] / t / t6407-merge-binary.sh
CommitLineData
b798671f
JH
1#!/bin/sh
2
3test_description='ask merge-recursive to merge binary files'
4
5902f5f4 5GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
334afbc7
JS
6export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
7
9081a421 8TEST_PASSES_SANITIZE_LEAK=true
b798671f
JH
9. ./test-lib.sh
10
11test_expect_success setup '
12
b5967f82 13 cat "$TEST_DIRECTORY"/test-binary-1.png >m &&
b798671f
JH
14 git add m &&
15 git ls-files -s | sed -e "s/ 0 / 1 /" >E1 &&
16 test_tick &&
17 git commit -m "initial" &&
18
19 git branch side &&
20 echo frotz >a &&
21 git add a &&
22 echo nitfol >>m &&
23 git add a m &&
24 git ls-files -s a >E0 &&
25 git ls-files -s m | sed -e "s/ 0 / 3 /" >E3 &&
26 test_tick &&
5902f5f4 27 git commit -m "main adds some" &&
b798671f
JH
28
29 git checkout side &&
30 echo rezrov >>m &&
31 git add m &&
32 git ls-files -s m | sed -e "s/ 0 / 2 /" >E2 &&
33 test_tick &&
34 git commit -m "side modifies" &&
35
36 git tag anchor &&
37
38 cat E0 E1 E2 E3 >expect
39'
40
41test_expect_success resolve '
42
43 rm -f a* m* &&
44 git reset --hard anchor &&
45
5902f5f4 46 if git merge -s resolve main
b798671f
JH
47 then
48 echo Oops, should not have succeeded
49 false
50 else
74d2f569 51 git ls-files -s >current &&
dcbaa0b3 52 test_cmp expect current
b798671f
JH
53 fi
54'
55
56test_expect_success recursive '
57
58 rm -f a* m* &&
59 git reset --hard anchor &&
60
5902f5f4 61 if git merge -s recursive main
b798671f
JH
62 then
63 echo Oops, should not have succeeded
64 false
65 else
74d2f569 66 git ls-files -s >current &&
dcbaa0b3 67 test_cmp expect current
b798671f
JH
68 fi
69'
70
71test_done