summaryrefslogtreecommitdiff
path: root/t/t4014-format-patch.sh
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2013-04-07 17:46:23 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-04-07 20:37:47 (GMT)
commit2a4c26076c3c99300a51439702791c17e7d21e6c (patch)
treef2499eb7971cc1ec377c28868f75a6a50a7d50bb /t/t4014-format-patch.sh
parentaa089cd9abc5332cddebc60c21f797fffd1ab471 (diff)
downloadgit-2a4c26076c3c99300a51439702791c17e7d21e6c.zip
git-2a4c26076c3c99300a51439702791c17e7d21e6c.tar.gz
git-2a4c26076c3c99300a51439702791c17e7d21e6c.tar.bz2
format-patch: add format.coverLetter configuration variable
Also, add a new option: 'auto', so if there's more than one patch, the cover letter is generated, otherwise it's not. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4014-format-patch.sh')
-rwxr-xr-xt/t4014-format-patch.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh
index 0ada8c7..8368181 100755
--- a/t/t4014-format-patch.sh
+++ b/t/t4014-format-patch.sh
@@ -1289,4 +1289,32 @@ test_expect_success 'cover letter with nothing' '
test_line_count = 0 actual
'
+test_expect_success 'cover letter auto' '
+ mkdir -p tmp &&
+ test_when_finished "rm -rf tmp;
+ git config --unset format.coverletter" &&
+
+ git config format.coverletter auto &&
+ git format-patch -o tmp -1 >list &&
+ test_line_count = 1 list &&
+ git format-patch -o tmp -2 >list &&
+ test_line_count = 3 list
+'
+
+test_expect_success 'cover letter auto user override' '
+ mkdir -p tmp &&
+ test_when_finished "rm -rf tmp;
+ git config --unset format.coverletter" &&
+
+ git config format.coverletter auto &&
+ git format-patch -o tmp --cover-letter -1 >list &&
+ test_line_count = 2 list &&
+ git format-patch -o tmp --cover-letter -2 >list &&
+ test_line_count = 3 list &&
+ git format-patch -o tmp --no-cover-letter -1 >list &&
+ test_line_count = 1 list &&
+ git format-patch -o tmp --no-cover-letter -2 >list &&
+ test_line_count = 2 list
+'
+
test_done