summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--builtin/tag.c2
-rwxr-xr-xt/t6300-for-each-ref.sh5
-rwxr-xr-xt/t7004-tag.sh6
3 files changed, 12 insertions, 1 deletions
diff --git a/builtin/tag.c b/builtin/tag.c
index fe0a8ab944..00382a56f5 100644
--- a/builtin/tag.c
+++ b/builtin/tag.c
@@ -158,7 +158,7 @@ static int git_tag_config(const char *var, const char *value, void *cb)
if (starts_with(var, "column."))
return git_column_config(var, value, "tag", &colopts);
- return git_default_config(var, value, cb);
+ return git_color_default_config(var, value, cb);
}
static void write_tag_body(int fd, const struct object_id *oid)
diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh
index 6358134805..09f2b7799d 100755
--- a/t/t6300-for-each-ref.sh
+++ b/t/t6300-for-each-ref.sh
@@ -441,6 +441,11 @@ test_expect_success '--color can override tty check' '
test_cmp expected.color actual
'
+test_expect_success 'color.ui=always does not override tty check' '
+ git -c color.ui=always for-each-ref --format="$color_format" >actual &&
+ test_cmp expected.bare actual
+'
+
cat >expected <<\EOF
heads/master
tags/master
diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index b90db1bf74..62aa322846 100755
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
@@ -1925,6 +1925,12 @@ test_expect_success '--color overrides auto-color' '
test_cmp expect.color actual
'
+test_expect_success 'color.ui=always overrides auto-color' '
+ git -c color.ui=always tag $color_args >actual.raw &&
+ test_decode_color <actual.raw >actual &&
+ test_cmp expect.color actual
+'
+
test_expect_success 'setup --merged test tags' '
git tag mergetest-1 HEAD~2 &&
git tag mergetest-2 HEAD~1 &&