summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-10-18 01:19:08 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-10-18 01:19:08 (GMT)
commit1c0b983a777bf283250aaf00c94a9a9d4bf8bc9c (patch)
treeda278177d16ce137f6b19de518b149ba6edcbdca /t
parent570676e011d9c8057744e03067553c4802e5adb4 (diff)
parentb521fd122865dca88b99d05344ec189d39efcefb (diff)
downloadgit-1c0b983a777bf283250aaf00c94a9a9d4bf8bc9c.zip
git-1c0b983a777bf283250aaf00c94a9a9d4bf8bc9c.tar.gz
git-1c0b983a777bf283250aaf00c94a9a9d4bf8bc9c.tar.bz2
Merge branch 'jk/ref-filter-colors-fix'
This is the "theoretically more correct" approach of simply stepping back to the state before plumbing commands started paying attention to "color.ui" configuration variable. Let's run with this one. * jk/ref-filter-colors-fix: tag: respect color.ui config Revert "color: check color.ui in git_default_config()" Revert "t6006: drop "always" color config tests" Revert "color: make "always" the same as "auto" in config"
Diffstat (limited to 't')
-rwxr-xr-xt/t6006-rev-list-format.sh20
-rwxr-xr-xt/t6300-for-each-ref.sh5
-rwxr-xr-xt/t7004-tag.sh6
3 files changed, 26 insertions, 5 deletions
diff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh
index 25a9c65..98be78b 100755
--- a/t/t6006-rev-list-format.sh
+++ b/t/t6006-rev-list-format.sh
@@ -208,11 +208,26 @@ do
has_no_color actual
'
+ test_expect_success "$desc enables colors for color.diff" '
+ git -c color.diff=always log --format=$color -1 >actual &&
+ has_color actual
+ '
+
+ test_expect_success "$desc enables colors for color.ui" '
+ git -c color.ui=always log --format=$color -1 >actual &&
+ has_color actual
+ '
+
test_expect_success "$desc respects --color" '
git log --format=$color -1 --color >actual &&
has_color actual
'
+ test_expect_success "$desc respects --no-color" '
+ git -c color.ui=always log --format=$color -1 --no-color >actual &&
+ has_no_color actual
+ '
+
test_expect_success TTY "$desc respects --color=auto (stdout is tty)" '
test_terminal git log --format=$color -1 --color=auto >actual &&
has_color actual
@@ -225,11 +240,6 @@ do
has_no_color actual
)
'
-
- test_expect_success TTY "$desc respects --no-color" '
- test_terminal git log --format=$color -1 --no-color >actual &&
- has_no_color actual
- '
done
test_expect_success '%C(always,...) enables color even without tty' '
diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh
index 416ff7d..3aa5349 100755
--- a/t/t6300-for-each-ref.sh
+++ b/t/t6300-for-each-ref.sh
@@ -442,6 +442,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 4e62c50..a9af2de 100755
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
@@ -1918,6 +1918,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 &&