]> git.ipfire.org Git - thirdparty/git.git/blob - t/t6407-merge-binary.sh
clone: allow "--bare" with "-o"
[thirdparty/git.git] / t / t6407-merge-binary.sh
1 #!/bin/sh
2
3 test_description='ask merge-recursive to merge binary files'
4
5 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
6 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
7
8 TEST_PASSES_SANITIZE_LEAK=true
9 . ./test-lib.sh
10
11 test_expect_success setup '
12
13 cat "$TEST_DIRECTORY"/test-binary-1.png >m &&
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 &&
27 git commit -m "main adds some" &&
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
41 test_expect_success resolve '
42
43 rm -f a* m* &&
44 git reset --hard anchor &&
45
46 test_must_fail git merge -s resolve main &&
47 git ls-files -s >current &&
48 test_cmp expect current
49 '
50
51 test_expect_success recursive '
52
53 rm -f a* m* &&
54 git reset --hard anchor &&
55
56 test_must_fail git merge -s recursive main &&
57 git ls-files -s >current &&
58 test_cmp expect current
59 '
60
61 test_done