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 &&
22 test_expect_success 'merge -s recursive up-to-date' '
24 git reset --hard c1 &&
26 git merge -s recursive c0 &&
27 expect=$(git rev-parse c1) &&
28 current=$(git rev-parse HEAD) &&
29 test "$expect" = "$current"
33 test_expect_success 'merge -s recursive fast-forward' '
35 git reset --hard c0 &&
37 git merge -s recursive c1 &&
38 expect=$(git rev-parse c1) &&
39 current=$(git rev-parse HEAD) &&
40 test "$expect" = "$current"
44 test_expect_success 'merge -s ours up-to-date' '
46 git reset --hard c1 &&
48 git merge -s ours c0 &&
49 expect=$(git rev-parse c1) &&
50 current=$(git rev-parse HEAD) &&
51 test "$expect" = "$current"
55 test_expect_success 'merge -s ours fast-forward' '
57 git reset --hard c0 &&
59 git merge -s ours c1 &&
60 expect=$(git rev-parse c0^{tree}) &&
61 current=$(git rev-parse HEAD^{tree}) &&
62 test "$expect" = "$current"
66 test_expect_success 'merge -s subtree up-to-date' '
68 git reset --hard c1 &&
70 git merge -s subtree c0 &&
71 expect=$(git rev-parse c1) &&
72 current=$(git rev-parse HEAD) &&
73 test "$expect" = "$current"