summaryrefslogtreecommitdiff
path: root/t/t6300-for-each-ref.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2011-09-07 17:44:56 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-09-08 20:52:00 (GMT)
commit7f6e275bc003e04fca63ae1058bb665078f72d7e (patch)
treef33c7d6fc07c0351a39f461305e4cf056e590b12 /t/t6300-for-each-ref.sh
parent7ec0f31eec66b854a2ca856538723dea5f1c0ab7 (diff)
downloadgit-7f6e275bc003e04fca63ae1058bb665078f72d7e.zip
git-7f6e275bc003e04fca63ae1058bb665078f72d7e.tar.gz
git-7f6e275bc003e04fca63ae1058bb665078f72d7e.tar.bz2
for-each-ref: handle multiline subjects like --pretty
Generally the format of a git tag or commit message is: subject body body body body body body However, we occasionally see multiline subjects like: subject with multiple lines body body body body body body The rest of git treats these multiline subjects as something to be concatenated and shown as a single line (e.g., "git log --pretty=format:%s" will do so since f53bd74). For consistency, for-each-ref should do the same with its "%(subject)". Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6300-for-each-ref.sh')
-rwxr-xr-xt/t6300-for-each-ref.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh
index 6fa4d52..0c9ff96 100755
--- a/t/t6300-for-each-ref.sh
+++ b/t/t6300-for-each-ref.sh
@@ -379,4 +379,25 @@ first body line
second body line
'
+test_expect_success 'create tag with multiline subject' '
+ cat >msg <<-\EOF &&
+ first subject line
+ second subject line
+
+ first body line
+ second body line
+ EOF
+ git tag -F msg multiline
+'
+test_atom refs/tags/multiline subject 'first subject line second subject line'
+test_atom refs/tags/multiline body 'first body line
+second body line
+'
+test_atom refs/tags/multiline contents 'first subject line
+second subject line
+
+first body line
+second body line
+'
+
test_done