summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorErik Faye-Lund <kusmabite@googlemail.com>2010-03-21 14:40:16 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-03-21 18:44:27 (GMT)
commit1fb5fdd25f018480b48f6a74f06bad7e04866440 (patch)
tree7cf30b98f099f3d047dd2620c6f06085045df71d /t
parent8fe5d87622a4268079bf1e5738474f85d4e5c3bc (diff)
downloadgit-1fb5fdd25f018480b48f6a74f06bad7e04866440.zip
git-1fb5fdd25f018480b48f6a74f06bad7e04866440.tar.gz
git-1fb5fdd25f018480b48f6a74f06bad7e04866440.tar.bz2
rev-list: fix --pretty=oneline with empty message
55246aa (Dont use "<unknown>" for placeholders and suppress printing of empty user formats) introduced a check to prevent empty user-formats from being printed. This test didn't take empty commit messages into account, and prevented the line-termination from being output. This lead to multiple commits on a single line. Correct it by guarding the check with a check for user-format. A similar correction for the --graph code-path has been included. Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t6006-rev-list-format.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh
index b0047d3..d24ca5c 100755
--- a/t/t6006-rev-list-format.sh
+++ b/t/t6006-rev-list-format.sh
@@ -209,4 +209,13 @@ test_expect_success '%gd shortens ref name' '
test_cmp expect.gd-short actual.gd-short
'
+test_expect_success 'oneline with empty message' '
+ git commit -m "dummy" --allow-empty &&
+ git commit -m "dummy" --allow-empty &&
+ git filter-branch --msg-filter "sed -e s/dummy//" HEAD^^.. &&
+ git rev-list --oneline HEAD > /tmp/test.txt &&
+ test $(git rev-list --oneline HEAD | wc -l) -eq 5 &&
+ test $(git rev-list --oneline --graph HEAD | wc -l) -eq 5
+'
+
test_done