summaryrefslogtreecommitdiff
path: root/pretty.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-06-20 11:01:01 -0700
committerJunio C Hamano <gitster@pobox.com>2016-06-20 11:01:01 -0700
commit1b3d14c1c89d8ad61be97a1f2d2606a07b25872b (patch)
tree1a3748c688b22878c33e90db84e827418656ea46 /pretty.c
parent3807098cd6abf4b94b6e0326255e5f5f0577f975 (diff)
parentb15a3e005af07843116c73205742adfbab3d2e82 (diff)
downloadgit-1b3d14c1c89d8ad61be97a1f2d2606a07b25872b.tar.gz
Merge branch 'et/pretty-format-c-auto'
The commands in `git log` family take %C(auto) in a custom format string. This unconditionally turned the color on, ignoring --no-color or with --color=auto when the output is not connected to a tty; this was corrected to make the format truly behave as "auto". * et/pretty-format-c-auto: format_commit_message: honor `color=auto` for `%C(auto)`
Diffstat (limited to 'pretty.c')
-rw-r--r--pretty.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pretty.c b/pretty.c
index 87c44971a1..c3ec430220 100644
--- a/pretty.c
+++ b/pretty.c
@@ -1063,7 +1063,7 @@ static size_t format_commit_one(struct strbuf *sb, /* in UTF-8 */
switch (placeholder[0]) {
case 'C':
if (starts_with(placeholder + 1, "(auto)")) {
- c->auto_color = 1;
+ c->auto_color = want_color(c->pretty_ctx->color);
return 7; /* consumed 7 bytes, "C(auto)" */
} else {
int ret = parse_color(sb, placeholder, c);