Code

Merge branch 'maint'
[git.git] / t / t7600-merge.sh
index 9ab5bdacc41d026ea81c65b0d95a61a61521429a..9516f541e9c47f83fed2fc8d3baa065a9bb206de 100755 (executable)
@@ -3,7 +3,7 @@
 # Copyright (c) 2007 Lars Hjemli
 #
 
-test_description='git-merge
+test_description='git merge
 
 Testing basic merge operations/option parsing.'
 
@@ -126,7 +126,7 @@ verify_merge() {
                echo "[OOPS] unmerged files"
                false
        fi &&
-       if ! git diff --exit-code
+       if test_must_fail git diff --exit-code
        then
                echo "[OOPS] working tree != index"
                false
@@ -221,7 +221,7 @@ test_expect_success 'setup' '
 
 test_debug 'gitk --all'
 
-test_expect_failure 'test option parsing' '
+test_expect_success 'test option parsing' '
        test_must_fail git merge -$ c1 &&
        test_must_fail git merge --no-such c1 &&
        test_must_fail git merge -s foobar c1 &&
@@ -230,6 +230,10 @@ test_expect_failure 'test option parsing' '
        test_must_fail git merge
 '
 
+test_expect_success 'reject non-strategy with a git-merge-foo name' '
+       test_must_fail git merge -s index c1
+'
+
 test_expect_success 'merge c0 with c1' '
        git reset --hard c0 &&
        git merge c1 &&
@@ -488,4 +492,23 @@ test_expect_success 'merge c1 with c1 and c2' '
 
 test_debug 'gitk --all'
 
+test_expect_success 'merge fast-forward in a dirty tree' '
+       git reset --hard c0 &&
+       mv file file1 &&
+       cat file1 >file &&
+       rm -f file1 &&
+       git merge c2
+'
+
+test_debug 'gitk --all'
+
+test_expect_success 'in-index merge' '
+       git reset --hard c0 &&
+       git merge --no-ff -s resolve c1 > out &&
+       grep "Wonderful." out &&
+       verify_parents $c0 $c1
+'
+
+test_debug 'gitk --all'
+
 test_done