Skip to content

Commit

Permalink
diff.c: fix a graph output bug
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bo Yang authored and Junio C Hamano committed Jul 9, 2010
1 parent e8344e8 commit e13f38a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -2627,8 +2627,7 @@ static void fill_metainfo(struct strbuf *msg,
(!fill_mmfile(&mf, two) && diff_filespec_is_binary(two)))
abbrev = 40;
}
strbuf_addf(msg, "%s%sindex %s..", set,
line_prefix,
strbuf_addf(msg, "%s%sindex %s..", line_prefix, set,
find_unique_abbrev(one->sha1, abbrev));
strbuf_addstr(msg, find_unique_abbrev(two->sha1, abbrev));
if (one->mode == two->mode)
Expand Down

0 comments on commit e13f38a

Please sign in to comment.