diff options
author | Jeff King <peff@peff.net> | 2017-04-27 05:01:05 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-04-28 11:40:52 +0900 |
commit | 75177c8591aee23374c2ead9c9505ce989a8eec2 (patch) | |
tree | ebb10a42b2981929e7f0f6c2e95c880dcc0d6cef /contrib/completion | |
parent | Git 2.13-rc1 (diff) | |
download | tgif-75177c8591aee23374c2ead9c9505ce989a8eec2.tar.xz |
status: fix missing newline when comment chars are disabled
When git-status shows tracking data for the current branch
in the long format, we try to end the stanza with a blank
line. When status.displayCommentPrefix is true, we call
color_fprintf_ln() to do so. But when it's false, we call
the enigmatic:
fputs("", s->fp);
which does nothing at all! This is a bug from 7d7d68022
(silence a bunch of format-zero-length warnings,
2014-05-04). Prior to that, we called fprintf_ln() with an
empty string. Switching to fputs() meant we needed to
include the "newline in the string, but we didn't.
So you see:
On branch jk/status-tracking-newline
Your branch is ahead of 'origin/master' by 1 commit.
Changes not staged for commit:
modified: foo
Untracked files:
bar
whereas there should be a blank line before the "Changes not
staged" line.
The fix itself is a one-liner. But we never noticed this
bug because t7508 doesn't exercise the ahead/behind code at
all. So let's configure an upstream during the initial
setup, which means that the code will be exercised as part
of all of the various invocations in that script. This makes
the diff rather noisy, but should give us good coverage.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/completion')
0 files changed, 0 insertions, 0 deletions