]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t4150-am.sh
t1407: make hash size independent
[thirdparty/git.git] / t / t4150-am.sh
index 1ebc587f8fc0010713f52196206462fa915cbca5..55b577d919b5d82dd8c8bc81a6a4bc657b190f41 100755 (executable)
@@ -69,13 +69,15 @@ test_expect_success 'setup: messages' '
 
        EOF
 
-       cat >scissors-msg <<-\EOF &&
-       Test git-am with scissors line
+       cat >msg-without-scissors-line <<-\EOF &&
+       Test that git-am --scissors cuts at the scissors line
 
        This line should be included in the commit message.
        EOF
 
-       cat - scissors-msg >no-scissors-msg <<-\EOF &&
+       printf "Subject: " >subject-prefix &&
+
+       cat - subject-prefix msg-without-scissors-line >msg-with-scissors-line <<-\EOF &&
        This line should not be included in the commit message with --scissors enabled.
 
         - - >8 - - remove everything above this line - - >8 - -
@@ -148,18 +150,17 @@ test_expect_success setup '
        } >patch1-hg.eml &&
 
 
-       echo scissors-file >scissors-file &&
-       git add scissors-file &&
-       git commit -F scissors-msg &&
-       git tag scissors &&
-       git format-patch --stdout scissors^ >scissors-patch.eml &&
+       echo file >file &&
+       git add file &&
+       git commit -F msg-without-scissors-line &&
+       git tag expected-for-scissors &&
        git reset --hard HEAD^ &&
 
-       echo no-scissors-file >no-scissors-file &&
-       git add no-scissors-file &&
-       git commit -F no-scissors-msg &&
-       git tag no-scissors &&
-       git format-patch --stdout no-scissors^ >no-scissors-patch.eml &&
+       echo file >file &&
+       git add file &&
+       git commit -F msg-with-scissors-line &&
+       git tag expected-for-no-scissors &&
+       git format-patch --stdout expected-for-no-scissors^ >patch-with-scissors-line.eml &&
        git reset --hard HEAD^ &&
 
        sed -n -e "3,\$p" msg >file &&
@@ -416,10 +417,10 @@ test_expect_success 'am --scissors cuts the message at the scissors line' '
        rm -fr .git/rebase-apply &&
        git reset --hard &&
        git checkout second &&
-       git am --scissors scissors-patch.eml &&
+       git am --scissors patch-with-scissors-line.eml &&
        test_path_is_missing .git/rebase-apply &&
-       git diff --exit-code scissors &&
-       test_cmp_rev scissors HEAD
+       git diff --exit-code expected-for-scissors &&
+       test_cmp_rev expected-for-scissors HEAD
 '
 
 test_expect_success 'am --no-scissors overrides mailinfo.scissors' '
@@ -427,10 +428,10 @@ test_expect_success 'am --no-scissors overrides mailinfo.scissors' '
        git reset --hard &&
        git checkout second &&
        test_config mailinfo.scissors true &&
-       git am --no-scissors no-scissors-patch.eml &&
+       git am --no-scissors patch-with-scissors-line.eml &&
        test_path_is_missing .git/rebase-apply &&
-       git diff --exit-code no-scissors &&
-       test_cmp_rev no-scissors HEAD
+       git diff --exit-code expected-for-no-scissors &&
+       test_cmp_rev expected-for-no-scissors HEAD
 '
 
 test_expect_success 'setup: new author and committer' '
@@ -651,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' '
@@ -874,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' '