Merge branch 'jk/verify-packfile-gently'
[gitweb.git] / t / t4021-format-patch-numbered.sh
index 709b3231ca8d9da631727b4aadfb2f46049d37e9..9be65fd4440a68af70e6630c8ded872d7be41f5d 100755 (executable)
@@ -36,6 +36,11 @@ test_no_numbered() {
        test_num_no_numbered $1 2
 }
 
+test_single_cover_letter_numbered() {
+       grep "^Subject: \[PATCH 0/1\]" $1 &&
+       grep "^Subject: \[PATCH 1/1\]" $1
+}
+
 test_single_numbered() {
        grep "^Subject: \[PATCH 1/1\]" $1
 }
@@ -95,7 +100,7 @@ test_expect_success 'format.numbered && --keep-subject' '
 
 test_expect_success 'format.numbered = auto' '
 
-       git config format.numbered auto
+       git config format.numbered auto &&
        git format-patch --stdout HEAD~2 > patch5 &&
        test_numbered patch5
 
@@ -121,4 +126,16 @@ test_expect_success '--start-number && --numbered' '
        grep "^Subject: \[PATCH 3/3\]" patch8
 '
 
+test_expect_success 'single patch with cover-letter defaults to numbers' '
+       git format-patch --cover-letter --stdout HEAD~1 >patch9.single &&
+       test_single_cover_letter_numbered patch9.single
+'
+
+test_expect_success 'Use --no-numbered and --cover-letter single patch' '
+       git format-patch --no-numbered --stdout --cover-letter HEAD~1 >patch10 &&
+       test_no_numbered patch10
+'
+
+
+
 test_done