summaryrefslogtreecommitdiff
path: root/builtin/rev-list.c
diff options
context:
space:
mode:
authorJacob Keller <jacob.keller@gmail.com>2016-10-20 20:41:00 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-10-20 21:44:37 (GMT)
commit98985c6911ca0d475ae7b4e5401e6eae58ed8489 (patch)
treede37aa7e7a3a40933390cf53688395f79b75bd76 /builtin/rev-list.c
parentfd47ae6a5b9cc0cfc56c1f7c43db612d26ca4b75 (diff)
downloadgit-98985c6911ca0d475ae7b4e5401e6eae58ed8489.zip
git-98985c6911ca0d475ae7b4e5401e6eae58ed8489.tar.gz
git-98985c6911ca0d475ae7b4e5401e6eae58ed8489.tar.bz2
rev-list: use hdr_termination instead of a always using a newline
When adding support for prefixing output of log and other commands using --line-prefix, commit 660e113ce118 ("graph: add support for --line-prefix on all graph-aware output", 2016-08-31) accidentally broke rev-list --header output. In order to make the output appear with a line-prefix, the flow was changed to always use the graph subsystem for display. Unfortunately the graph flow in rev-list did not use info->hdr_termination as it was assumed that graph output would never need to putput NULs. Since we now always use the graph code in order to handle the case of line-prefix, simply replace putchar('\n') with putchar(info->hdr_termination) which will correct this issue. Add a test for the --header case to make sure we don't break it in the future. Reported-by: Dennis Kaarsemaker <dennis@kaarsemaker.net> Signed-off-by: Jacob Keller <jacob.keller@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Jacob Keller <jacob.keller@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/rev-list.c')
-rw-r--r--builtin/rev-list.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/rev-list.c b/builtin/rev-list.c
index 8479f6e..c43decd 100644
--- a/builtin/rev-list.c
+++ b/builtin/rev-list.c
@@ -145,7 +145,7 @@ static void show_commit(struct commit *commit, void *data)
*/
if (buf.len && buf.buf[buf.len - 1] == '\n')
graph_show_padding(revs->graph);
- putchar('\n');
+ putchar(info->hdr_termination);
} else {
/*
* If the message buffer is empty, just show