diff options
author | Felipe Contreras <felipe.contreras@gmail.com> | 2013-04-07 12:46:23 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-04-07 13:37:47 -0700 |
commit | 2a4c26076c3c99300a51439702791c17e7d21e6c (patch) | |
tree | f2499eb7971cc1ec377c28868f75a6a50a7d50bb /t | |
parent | aa089cd9abc5332cddebc60c21f797fffd1ab471 (diff) | |
download | git-2a4c26076c3c99300a51439702791c17e7d21e6c.tar.gz |
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')
-rwxr-xr-x | t/t4014-format-patch.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index 0ada8c78e7..8368181d6c 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 |