3 test_description
='merge fast-forward and up to date'
5 TEST_PASSES_SANITIZE_LEAK
=true
8 test_expect_success setup
'
12 git commit -m initial &&
18 git commit -m second &&
24 git commit -m third &&
28 test_expect_success
'merge -s recursive up-to-date' '
30 git reset --hard c1 &&
32 git merge -s recursive c0 &&
33 expect=$(git rev-parse c1) &&
34 current=$(git rev-parse HEAD) &&
35 test "$expect" = "$current"
39 test_expect_success
'merge -s recursive fast-forward' '
41 git reset --hard c0 &&
43 git merge -s recursive c1 &&
44 expect=$(git rev-parse c1) &&
45 current=$(git rev-parse HEAD) &&
46 test "$expect" = "$current"
50 test_expect_success
'merge -s ours up-to-date' '
52 git reset --hard c1 &&
54 git merge -s ours c0 &&
55 expect=$(git rev-parse c1) &&
56 current=$(git rev-parse HEAD) &&
57 test "$expect" = "$current"
61 test_expect_success
'merge -s ours fast-forward' '
63 git reset --hard c0 &&
65 git merge -s ours c1 &&
66 expect=$(git rev-parse c0^{tree}) &&
67 current=$(git rev-parse HEAD^{tree}) &&
68 test "$expect" = "$current"
72 test_expect_success
'merge -s subtree up-to-date' '
74 git reset --hard c1 &&
76 git merge -s subtree c0 &&
77 expect=$(git rev-parse c1) &&
78 current=$(git rev-parse HEAD) &&
79 test "$expect" = "$current"
83 test_expect_success
'merge fast-forward octopus' '
85 git reset --hard c0 &&
88 expect=$(git rev-parse c2) &&
89 current=$(git rev-parse HEAD) &&
90 test "$expect" = "$current"