Skip to content

Commit e13f38a

Browse files
byanggitster
authored andcommitted
diff.c: fix a graph output bug
When --graph is in effect, the line-prefix typically has colored graph line segments and ends with reset. The color sequence "set" given to this function is for showing the metainfo part of the patch text and (1) it should not be applied to the graph lines, and (2) it will be reset at the end of line_prefix so it won't be in effect anyway. Signed-off-by: Bo Yang <struggleyb.nku@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent e8344e8 commit e13f38a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

diff.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2627,8 +2627,7 @@ static void fill_metainfo(struct strbuf *msg,
26272627
(!fill_mmfile(&mf, two) && diff_filespec_is_binary(two)))
26282628
abbrev = 40;
26292629
}
2630-
strbuf_addf(msg, "%s%sindex %s..", set,
2631-
line_prefix,
2630+
strbuf_addf(msg, "%s%sindex %s..", line_prefix, set,
26322631
find_unique_abbrev(one->sha1, abbrev));
26332632
strbuf_addstr(msg, find_unique_abbrev(two->sha1, abbrev));
26342633
if (one->mode == two->mode)

0 commit comments

Comments
 (0)