Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
pretty: avoid adding reset for %C(auto) if output is empty
[gitweb.git]
/
pretty.c
diff --git
a/pretty.c
b/pretty.c
index b86c5bb907ee8607d054f8afde6ab15f8c90a183..bad1bfb225a32f51920c1c6fdd1085b8b46bfc58 100644
(file)
--- a/
pretty.c
+++ b/
pretty.c
@@
-1062,7
+1062,7
@@
static size_t format_commit_one(struct strbuf *sb, /* in UTF-8 */
case 'C':
if (starts_with(placeholder + 1, "(auto)")) {
c->auto_color = want_color(c->pretty_ctx->color);
- if (c->auto_color)
+ if (c->auto_color
&& sb->len
)
strbuf_addstr(sb, GIT_COLOR_RESET);
return 7; /* consumed 7 bytes, "C(auto)" */
} else {