Merge branch 'rt/for-each-ref-spell-tcl-as-Tcl'
[gitweb.git] / t / t4150-am.sh
index 5edb79a058f407f47353041afb8e7851b066a517..306e6f39ac88e7ee4ee0fb16dee12cf999fbba1b 100755 (executable)
@@ -85,6 +85,7 @@ test_expect_success setup '
 
        git format-patch --stdout first >patch1 &&
        {
+               echo "Message-Id: <1226501681-24923-1-git-send-email-bda@mnsspb.ru>" &&
                echo "X-Fake-Field: Line One" &&
                echo "X-Fake-Field: Line Two" &&
                echo "X-Fake-Field: Line Three" &&
@@ -536,4 +537,26 @@ test_expect_success 'am empty-file does not infloop' '
        test_i18ncmp expected actual
 '
 
+test_expect_success 'am --message-id really adds the message id' '
+       rm -fr .git/rebase-apply &&
+       git reset --hard &&
+       git checkout HEAD^ &&
+       git am --message-id patch1.eml &&
+       test_path_is_missing .git/rebase-apply &&
+       git cat-file commit HEAD | tail -n1 >actual &&
+       grep Message-Id patch1.eml >expected &&
+       test_cmp expected actual
+'
+
+test_expect_success 'am --message-id -s signs off after the message id' '
+       rm -fr .git/rebase-apply &&
+       git reset --hard &&
+       git checkout HEAD^ &&
+       git am -s --message-id patch1.eml &&
+       test_path_is_missing .git/rebase-apply &&
+       git cat-file commit HEAD | tail -n2 | head -n1 >actual &&
+       grep Message-Id patch1.eml >expected &&
+       test_cmp expected actual
+'
+
 test_done