travis-ci: record and skip successfully built trees
[gitweb.git] / t / t7004-tag.sh
index 0ef7b94394151da9a9a6d602952e7f2fa64cf6a4..dd5ba450ee4b33801dc39d0b57e4c4b08c1dfd62 100755 (executable)
@@ -9,6 +9,7 @@ Tests for operations with tags.'
 
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-gpg.sh
+. "$TEST_DIRECTORY"/lib-terminal.sh
 
 # creating and listing lightweight tags:
 
@@ -1900,6 +1901,30 @@ test_expect_success '--format should list tags as per format given' '
        test_cmp expect actual
 '
 
+test_expect_success "set up color tests" '
+       echo "<RED>v1.0<RESET>" >expect.color &&
+       echo "v1.0" >expect.bare &&
+       color_args="--format=%(color:red)%(refname:short) --list v1.0"
+'
+
+test_expect_success '%(color) omitted without tty' '
+       TERM=vt100 git tag $color_args >actual.raw &&
+       test_decode_color <actual.raw >actual &&
+       test_cmp expect.bare actual
+'
+
+test_expect_success TTY '%(color) present with tty' '
+       test_terminal env TERM=vt100 git tag $color_args >actual.raw &&
+       test_decode_color <actual.raw >actual &&
+       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 &&