summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pretty.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/pretty.c b/pretty.c
index 9788bd8f3f..25efbcac92 100644
--- a/pretty.c
+++ b/pretty.c
@@ -1072,6 +1072,8 @@ 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 && sb->len)
+ strbuf_addstr(sb, GIT_COLOR_RESET);
return 7; /* consumed 7 bytes, "C(auto)" */
} else {
int ret = parse_color(sb, placeholder, c);