summaryrefslogtreecommitdiff
path: root/t/t4014-format-patch.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-04-18 18:49:11 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-04-18 18:49:11 (GMT)
commit288aa7534ae79eef03f79aaec355a7eedb08ddfa (patch)
tree5316efce15cad491893eb91fbb87cecb767f0f17 /t/t4014-format-patch.sh
parent54a3c67375384a38eae946b7996d226dbd9c26d4 (diff)
parent0597ffa5ecff1b83f384357ab88afaf21838caa2 (diff)
downloadgit-288aa7534ae79eef03f79aaec355a7eedb08ddfa.zip
git-288aa7534ae79eef03f79aaec355a7eedb08ddfa.tar.gz
git-288aa7534ae79eef03f79aaec355a7eedb08ddfa.tar.bz2
Merge branch 'fc/send-email-annotate'
Allows format-patch --cover-letter to be configurable; the most notable is the "auto" mode to create cover-letter only for multi patch series. * fc/send-email-annotate: rebase-am: explicitly disable cover-letter format-patch: trivial cleanups format-patch: add format.coverLetter configuration variable log: update to OPT_BOOL format-patch: refactor branch name calculation format-patch: improve head calculation for cover-letter send-email: make annotate configurable
Diffstat (limited to 't/t4014-format-patch.sh')
-rwxr-xr-xt/t4014-format-patch.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh
index 86ee077..58d4180 100755
--- a/t/t4014-format-patch.sh
+++ b/t/t4014-format-patch.sh
@@ -1284,4 +1284,37 @@ test_expect_success 'cover letter using branch description (6)' '
grep hello actual >/dev/null
'
+test_expect_success 'cover letter with nothing' '
+ git format-patch --stdout --cover-letter >actual &&
+ 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