Skip to content

Commit d347fb6

Browse files
committed
Merge branch 'jk/diff-submodule-diff-inline'
A recently graduated topic regressed "git rev-list --header" output, breaking "gitweb". This has been fixed. * jk/diff-submodule-diff-inline: rev-list: use hdr_termination instead of a always using a newline
2 parents 7849872 + 98985c6 commit d347fb6

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

builtin/rev-list.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ static void show_commit(struct commit *commit, void *data)
145145
*/
146146
if (buf.len && buf.buf[buf.len - 1] == '\n')
147147
graph_show_padding(revs->graph);
148-
putchar('\n');
148+
putchar(info->hdr_termination);
149149
} else {
150150
/*
151151
* If the message buffer is empty, just show

t/t6000-rev-list-misc.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,18 @@ test_expect_success '--bisect and --first-parent can not be combined' '
100100
test_must_fail git rev-list --bisect --first-parent HEAD
101101
'
102102

103+
test_expect_success '--header shows a NUL after each commit' '
104+
# We know that there is no Q in the true payload; names and
105+
# addresses of the authors and the committers do not have
106+
# any, and object names or header names do not, either.
107+
git rev-list --header --max-count=2 HEAD |
108+
nul_to_q |
109+
grep "^Q" >actual &&
110+
cat >expect <<-EOF &&
111+
Q$(git rev-parse HEAD~1)
112+
Q
113+
EOF
114+
test_cmp expect actual
115+
'
116+
103117
test_done

0 commit comments

Comments
 (0)