Code

tests: Add tests for missing format-patch long options
authorStephen Boyd <bebarino@gmail.com>
Sat, 16 May 2009 09:24:45 +0000 (02:24 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sat, 16 May 2009 18:47:19 +0000 (11:47 -0700)
Exercise format-patch's --signoff, --in-reply-to and --start-number long
options.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t4014-format-patch.sh
t/t4021-format-patch-numbered.sh

index 11061ddd5bd122a1e180509c018e1b8bea42ddc3..922a8941ed4720e2ad6dcd500a3759187aace969 100755 (executable)
@@ -505,4 +505,15 @@ test_expect_success 'format-patch from a subdirectory (3)' '
        test -f "$basename"
 '
 
+test_expect_success 'format-patch --in-reply-to' '
+       git format-patch -1 --stdout --in-reply-to "baz@foo.bar" > patch8 &&
+       grep "^In-Reply-To: <baz@foo.bar>" patch8 &&
+       grep "^References: <baz@foo.bar>" patch8
+'
+
+test_expect_success 'format-patch --signoff' '
+       git format-patch -1 --signoff --stdout |
+       grep "^Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>"
+'
+
 test_done
index 390af2389f3b9559fcfebe1e21a24317562ab7af..3c27f0dc19648e6c21ff4b1702f3e93f4b64755e 100755 (executable)
@@ -108,4 +108,10 @@ test_expect_success 'format.numbered = auto && --no-numbered' '
 
 '
 
+test_expect_success '--start-number && --numbered' '
+
+       git format-patch --start-number 3 --numbered --stdout HEAD~1 > patch8 &&
+       grep "^Subject: \[PATCH 3/3\]" patch8
+'
+
 test_done