summaryrefslogtreecommitdiff
path: root/t/t4014-format-patch.sh
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2013-04-07 17:46:20 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-04-07 20:32:41 (GMT)
commit80d35ca0aaeca654562974be6ea528e22bc76e8c (patch)
tree957c277a944dfaa40f1ea4383b15f1ea528b1811 /t/t4014-format-patch.sh
parent402596aafa45ef371611bb795bdf8daa2bdb9286 (diff)
downloadgit-80d35ca0aaeca654562974be6ea528e22bc76e8c.zip
git-80d35ca0aaeca654562974be6ea528e22bc76e8c.tar.gz
git-80d35ca0aaeca654562974be6ea528e22bc76e8c.tar.bz2
format-patch: improve head calculation for cover-letter
If we do it after the revision traversal we can be sure that this is indeed a commit that will be processed (i.e. not a merge) and it's the top most one (thus removing the NEEDSWORK comment, at least we show the same as 'git diff --stat' output that appears in the cover-letter). While we are at it, since we know there's nothing to generate, exit sooner in all cases, like --cover-letter currently does. Also, if there's nothing to generate and cover-letter is specified, a different code-path might be triggered that is not currently covered in the test-case, so add a test for it. 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.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh
index b993dae..0ada8c7 100755
--- a/t/t4014-format-patch.sh
+++ b/t/t4014-format-patch.sh
@@ -1284,4 +1284,9 @@ 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_done