aboutsummaryrefslogtreecommitdiff
path: root/t/t7502-commit.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-11-06 23:06:06 -0800
committerJunio C Hamano <gitster@pobox.com>2009-11-06 23:17:26 -0800
commite5138436ddd4b5f75c1e910f6b844e4fcf91343d (patch)
tree59975bc8e3cb2fca73c02cbe179f09986cbca554 /t/t7502-commit.sh
parentc1e01b0c5106451770ae77a62f52acfe814c3326 (diff)
downloadgit-e5138436ddd4b5f75c1e910f6b844e4fcf91343d.tar.gz
git-e5138436ddd4b5f75c1e910f6b844e4fcf91343d.tar.xz
builtin-commit.c: fix logic to omit empty line before existing footers
"commit -s" used to add an empty line before adding S-o-b line only when the last line of the existing log message is not another S-o-b line, but c1e01b0 (commit: More generous accepting of RFC-2822 footer lines., 2009-10-28) introduced logic to omit this empty line when the message ends with a run of "footer" lines, to cover S-o-b's friends, e.g. Acked-by. However, the logic was overzealous and missed one corner case. A message that consists of a single line that begins with Token + colon, it can be mistaken as a S-o-b's friend. We do want an empty line in such a case. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7502-commit.sh')
-rwxr-xr-xt/t7502-commit.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/t/t7502-commit.sh b/t/t7502-commit.sh
index 56cd86601..fe9455229 100755
--- a/t/t7502-commit.sh
+++ b/t/t7502-commit.sh
@@ -258,4 +258,13 @@ test_expect_success 'Hand committing of a redundant merge removes dups' '
'
+test_expect_success 'A single-liner subject with a token plus colon is not a footer' '
+
+ git reset --hard &&
+ git commit -s -m "hello: kitty" --allow-empty &&
+ git cat-file commit HEAD | sed -e "1,/^$/d" >actual &&
+ test $(wc -l <actual) = 3
+
+'
+
test_done