tests: use $TEST_DIRECTORY to refer to the t/ directory
[git/git.git] / t / t6027-merge-binary.sh
1 #!/bin/sh
2
3 test_description='ask merge-recursive to merge binary files'
4
5 . ./test-lib.sh
6
7 test_expect_success setup '
8
9 cat "$TEST_DIRECTORY"/test4012.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" &&
14
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" &&
24
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" &&
31
32 git tag anchor &&
33
34 cat E0 E1 E2 E3 >expect
35 '
36
37 test_expect_success resolve '
38
39 rm -f a* m* &&
40 git reset --hard anchor &&
41
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
49 fi
50 '
51
52 test_expect_success recursive '
53
54 rm -f a* m* &&
55 git reset --hard anchor &&
56
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
64 fi
65 '
66
67 test_done