summaryrefslogtreecommitdiff
path: root/t/t6006-rev-list-format.sh
diff options
context:
space:
mode:
authorMichael J Gruber <git@drmicha.warpmail.net>2010-06-14 16:12:29 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-06-16 21:45:09 (GMT)
commit7b88176e9bce658fd44c2192c1b7aa6e612ee0c2 (patch)
treeb69a131050b6b093f75addb97094118ba7c96d19 /t/t6006-rev-list-format.sh
parent6068cdcc832040ac644c56953be0670bb09afd12 (diff)
downloadgit-7b88176e9bce658fd44c2192c1b7aa6e612ee0c2.zip
git-7b88176e9bce658fd44c2192c1b7aa6e612ee0c2.tar.gz
git-7b88176e9bce658fd44c2192c1b7aa6e612ee0c2.tar.bz2
pretty: Introduce ' ' modifier to add space if non-empty
We have the '+' modifiier which helps combine format specifiers which may possibly be empty, e.g. '%s%+b%n'. Introduce an analogous ' ' (space) modifier which adds a space before non-empty items. This helps assemble "one line type" format specifiers. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6006-rev-list-format.sh')
-rwxr-xr-xt/t6006-rev-list-format.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh
index 9b77073..cccacd4 100755
--- a/t/t6006-rev-list-format.sh
+++ b/t/t6006-rev-list-format.sh
@@ -200,6 +200,16 @@ test_expect_success 'add LF before non-empty (2)' '
grep "^$" actual
'
+test_expect_success 'add SP before non-empty (1)' '
+ git show -s --pretty=format:"%s% bThanks" HEAD^^ >actual &&
+ test $(wc -w <actual) = 2
+'
+
+test_expect_success 'add SP before non-empty (2)' '
+ git show -s --pretty=format:"%s% sThanks" HEAD^^ >actual &&
+ test $(wc -w <actual) = 4
+'
+
test_expect_success '--abbrev' '
echo SHORT SHORT SHORT >expect2 &&
echo LONG LONG LONG >expect3 &&