Code

Catch invalid --depth option passed to clone or fetch
[git.git] / t / t4151-am-abort.sh
index 7d86cdff64522f588a3d3e781cf2b272087cfd88..c95c4ccc393d0863ad53b6a2a684893282d7d9e6 100755 (executable)
@@ -22,7 +22,7 @@ test_expect_success setup '
                test_tick &&
                git commit -a -m $i || break
        done &&
-       git format-patch initial &&
+       git format-patch --no-numbered initial &&
        git checkout -b side initial &&
        echo local change >file-2-expect
 '
@@ -44,22 +44,31 @@ do
        '
 
        test_expect_success "am$with3 --skip continue after failed am$with3" '
-               test_must_fail git-am$with3 --skip >output &&
+               test_must_fail git am$with3 --skip >output &&
                test "$(grep "^Applying" output)" = "Applying: 6" &&
                test_cmp file-2-expect file-2 &&
-               test ! -f .git/rr-cache/MERGE_RR
+               test ! -f .git/MERGE_RR
        '
 
        test_expect_success "am --abort goes back after failed am$with3" '
-               git-am --abort &&
+               git am --abort &&
                git rev-parse HEAD >actual &&
                git rev-parse initial >expect &&
                test_cmp expect actual &&
                test_cmp file-2-expect file-2 &&
                git diff-index --exit-code --cached HEAD &&
-               test ! -f .git/rr-cache/MERGE_RR
+               test ! -f .git/MERGE_RR
        '
 
 done
 
+test_expect_success 'am --abort will keep the local commits intact' '
+       test_must_fail git am 0004-*.patch &&
+       test_commit unrelated &&
+       git rev-parse HEAD >expect &&
+       git am --abort &&
+       git rev-parse HEAD >actual &&
+       test_cmp expect actual
+'
+
 test_done