3 test_description
="git merge
5 Testing a custom strategy.
7 * (HEAD, master) Merge commit 'c2'
17 test_expect_success
'set up custom strategy' '
18 cat >git-merge-theirs <<-EOF &&
20 eval git read-tree --reset -u \\\$\$#
23 chmod +x git-merge-theirs &&
28 test_expect_success
'setup' '
29 test_commit c0 c0.c &&
30 test_commit c1 c1.c &&
31 git reset --keep c0 &&
37 test_expect_success
'merge c2 with a custom strategy' '
38 git reset --hard c1 &&
40 git rev-parse c1 >head.old &&
41 git rev-parse c2 >second-parent.expected &&
42 git rev-parse c2^{tree} >tree.expected &&
43 git merge -s theirs c2 &&
45 git rev-parse HEAD >head &&
46 git rev-parse HEAD^1 >first-parent &&
47 git rev-parse HEAD^2 >second-parent &&
48 git rev-parse HEAD^{tree} >tree &&
49 git update-index --refresh &&
50 git diff --exit-code &&
51 git diff --exit-code c2 HEAD &&
52 git diff --exit-code c2 &&
54 ! test_cmp head.old head &&
55 test_cmp head.old first-parent &&
56 test_cmp second-parent.expected second-parent &&
57 test_cmp tree.expected tree &&