3 test_description
='merge fast-forward and up to date'
7 test_expect_success setup
'
11 git commit -m initial &&
17 git commit -m second &&
23 git commit -m third &&
27 test_expect_success
'merge -s recursive up-to-date' '
29 git reset --hard c1 &&
31 git merge -s recursive c0 &&
32 expect=$(git rev-parse c1) &&
33 current=$(git rev-parse HEAD) &&
34 test "$expect" = "$current"
38 test_expect_success
'merge -s recursive fast-forward' '
40 git reset --hard c0 &&
42 git merge -s recursive c1 &&
43 expect=$(git rev-parse c1) &&
44 current=$(git rev-parse HEAD) &&
45 test "$expect" = "$current"
49 test_expect_success
'merge -s ours up-to-date' '
51 git reset --hard c1 &&
53 git merge -s ours c0 &&
54 expect=$(git rev-parse c1) &&
55 current=$(git rev-parse HEAD) &&
56 test "$expect" = "$current"
60 test_expect_success
'merge -s ours fast-forward' '
62 git reset --hard c0 &&
64 git merge -s ours c1 &&
65 expect=$(git rev-parse c0^{tree}) &&
66 current=$(git rev-parse HEAD^{tree}) &&
67 test "$expect" = "$current"
71 test_expect_success
'merge -s subtree up-to-date' '
73 git reset --hard c1 &&
75 git merge -s subtree c0 &&
76 expect=$(git rev-parse c1) &&
77 current=$(git rev-parse HEAD) &&
78 test "$expect" = "$current"
82 test_expect_success
'merge fast-forward octopus' '
84 git reset --hard c0 &&
87 expect=$(git rev-parse c2) &&
88 current=$(git rev-parse HEAD) &&
89 test "$expect" = "$current"