aboutsummaryrefslogtreecommitdiff
path: root/t/t6006-rev-list-format.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-01-06 04:21:07 -0800
committerJunio C Hamano <gitster@pobox.com>2008-01-06 18:41:43 -0800
commitf7ab5c793707082d41e19093f536cdc0d45d8830 (patch)
treed754745b47aa69a50130c0f1d2f37a8d9f01e2fc /t/t6006-rev-list-format.sh
parent5682694a3c1f272f230301f2b11a834a141d1efe (diff)
downloadgit-f7ab5c793707082d41e19093f536cdc0d45d8830.tar.gz
git-f7ab5c793707082d41e19093f536cdc0d45d8830.tar.xz
custom pretty format: tolerate empty e-mail address
When e-mail address is empty (e.g. "A U Thor <>"), --pretty=format misparsed the commit header and did not pick up the date field correctly. Noticed by Marco, fixed slightly differently with additional sanity check and with a test. 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 1e4541afe..0dc915ea6 100755
--- a/t/t6006-rev-list-format.sh
+++ b/t/t6006-rev-list-format.sh
@@ -139,4 +139,14 @@ commit 131a310eb913d107dd3c09a65d1651175898735d
commit 86c75cfd708a0e5868dc876ed5b8bb66c80b4873
EOF
+test_expect_success 'empty email' '
+ test_tick &&
+ C=$(GIT_AUTHOR_EMAIL= git commit-tree HEAD^{tree} </dev/null) &&
+ A=$(git show --pretty=format:%an,%ae,%ad%n -s $C) &&
+ test "$A" = "A U Thor,,Thu Apr 7 15:14:13 2005 -0700" || {
+ echo "Eh? $A" >failure
+ false
+ }
+'
+
test_done