convert add_files_to_cache to take struct pathspec
[alt-git.git] / t / t6027-merge-binary.sh
blob07735410b9536ba7639134c7ca0cda4f486f8291
1 #!/bin/sh
3 test_description='ask merge-recursive to merge binary files'
5 . ./test-lib.sh
7 test_expect_success setup '
9 cat "$TEST_DIRECTORY"/test-binary-1.png >m &&
10 git add m &&
11 git ls-files -s | sed -e "s/ 0 / 1 /" >E1 &&
12 test_tick &&
13 git commit -m "initial" &&
15 git branch side &&
16 echo frotz >a &&
17 git add a &&
18 echo nitfol >>m &&
19 git add a m &&
20 git ls-files -s a >E0 &&
21 git ls-files -s m | sed -e "s/ 0 / 3 /" >E3 &&
22 test_tick &&
23 git commit -m "master adds some" &&
25 git checkout side &&
26 echo rezrov >>m &&
27 git add m &&
28 git ls-files -s m | sed -e "s/ 0 / 2 /" >E2 &&
29 test_tick &&
30 git commit -m "side modifies" &&
32 git tag anchor &&
34 cat E0 E1 E2 E3 >expect
37 test_expect_success resolve '
39 rm -f a* m* &&
40 git reset --hard anchor &&
42 if git merge -s resolve master
43 then
44 echo Oops, should not have succeeded
45 false
46 else
47 git ls-files -s >current
48 test_cmp current expect
52 test_expect_success recursive '
54 rm -f a* m* &&
55 git reset --hard anchor &&
57 if git merge -s recursive master
58 then
59 echo Oops, should not have succeeded
60 false
61 else
62 git ls-files -s >current
63 test_cmp current expect
67 test_done