travis-ci: install packages in 'ci/install-dependencies.sh'
[gitweb.git] / t / t4150-am.sh
index 91a3bb2bac8b4ce8c7624a6231f15ce7c9249fb4..55b577d919b5d82dd8c8bc81a6a4bc657b190f41 100755 (executable)
@@ -142,8 +142,8 @@ test_expect_success setup '
                echo "# User $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>" &&
                echo "# Date $test_tick 25200" &&
                echo "#      $(git show --pretty="%aD" -s second)" &&
-               echo "# Node ID $_z40" &&
-               echo "# Parent  $_z40" &&
+               echo "# Node ID $ZERO_OID" &&
+               echo "# Parent  $ZERO_OID" &&
                cat msg &&
                echo &&
                git diff-tree --no-commit-id -p second
@@ -652,7 +652,7 @@ test_expect_success 'am -3 -q is quiet' '
        git checkout -f lorem2 &&
        git reset base3way --hard &&
        git am -3 -q lorem-move.patch >output.out 2>&1 &&
-       ! test -s output.out
+       test_must_be_empty output.out
 '
 
 test_expect_success 'am pauses on conflict' '
@@ -663,6 +663,11 @@ test_expect_success 'am pauses on conflict' '
        test -d .git/rebase-apply
 '
 
+test_expect_success 'am --show-current-patch' '
+       git am --show-current-patch >actual.patch &&
+       test_cmp .git/rebase-apply/0001 actual.patch
+'
+
 test_expect_success 'am --skip works' '
        echo goodbye >expected &&
        git am --skip &&
@@ -870,7 +875,7 @@ test_expect_success 'am -q is quiet' '
        git checkout first &&
        test_tick &&
        git am -q <patch1 >output.out 2>&1 &&
-       ! test -s output.out
+       test_must_be_empty output.out
 '
 
 test_expect_success 'am empty-file does not infloop' '
@@ -1046,4 +1051,16 @@ test_expect_success 'am works with multi-line in-body headers' '
        git cat-file commit HEAD | grep "^$LONG$"
 '
 
+test_expect_success 'am --quit keeps HEAD where it is' '
+       mkdir .git/rebase-apply &&
+       >.git/rebase-apply/last &&
+       >.git/rebase-apply/next &&
+       git rev-parse HEAD^ >.git/ORIG_HEAD &&
+       git rev-parse HEAD >expected &&
+       git am --quit &&
+       test_path_is_missing .git/rebase-apply &&
+       git rev-parse HEAD >actual &&
+       test_cmp expected actual
+'
+
 test_done