summaryrefslogtreecommitdiff
path: root/pretty.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2016-06-20 11:01:01 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-06-20 11:01:01 -0700
commit1b3d14c1c89d8ad61be97a1f2d2606a07b25872b (patch)
tree1a3748c688b22878c33e90db84e827418656ea46 /pretty.c
parentMerge branch 'sb/submodule-recommend-shallowness' (diff)
parentformat_commit_message: honor `color=auto` for `%C(auto)` (diff)
downloadtgif-1b3d14c1c89d8ad61be97a1f2d2606a07b25872b.tar.xz
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);