diff options
author | Erik Faye-Lund <kusmabite@googlemail.com> | 2010-03-21 15:40:16 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-03-21 11:44:27 -0700 |
commit | 1fb5fdd25f018480b48f6a74f06bad7e04866440 (patch) | |
tree | 7cf30b98f099f3d047dd2620c6f06085045df71d /builtin-rev-list.c | |
parent | 8fe5d87622a4268079bf1e5738474f85d4e5c3bc (diff) | |
download | git-1fb5fdd25f018480b48f6a74f06bad7e04866440.tar.gz |
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 'builtin-rev-list.c')
-rw-r--r-- | builtin-rev-list.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/builtin-rev-list.c b/builtin-rev-list.c index 5679170e82..1db4b4ccc6 100644 --- a/builtin-rev-list.c +++ b/builtin-rev-list.c @@ -133,9 +133,12 @@ static void show_commit(struct commit *commit, void *data) */ if (graph_show_remainder(revs->graph)) putchar('\n'); + if (revs->commit_format == CMIT_FMT_ONELINE) + putchar('\n'); } } else { - if (buf.len) + if (revs->commit_format != CMIT_FMT_USERFORMAT || + buf.len) printf("%s%c", buf.buf, info->hdr_termination); } strbuf_release(&buf); |