From: Junio C Hamano Date: Sun, 10 Sep 2017 08:02:56 +0000 (+0900) Subject: Merge branch 'ab/ref-filter-no-contains' into maint X-Git-Tag: v2.14.2~22 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/1eb539a9b3ed2af95992bf9460bd77b4bc5fea23?ds=inline;hp=-c Merge branch 'ab/ref-filter-no-contains' into maint A test fix. * ab/ref-filter-no-contains: tests: don't give unportable ">" to "test" built-in, use -gt --- 1eb539a9b3ed2af95992bf9460bd77b4bc5fea23 diff --combined t/t7004-tag.sh index dd5ba450ee,c6791cf396..dbcd6f623c --- a/t/t7004-tag.sh +++ b/t/t7004-tag.sh @@@ -9,7 -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: @@@ -88,7 -87,7 +88,7 @@@ test_expect_success 'creating a tag wit git tag --create-reflog tag_with_reflog && git reflog exists refs/tags/tag_with_reflog && sed -e "s/^.* //" .git/logs/refs/tags/tag_with_reflog >actual && - test_cmp expected actual + test_i18ncmp expected actual ' test_expect_success 'annotated tag with --create-reflog has correct message' ' @@@ -99,7 -98,7 +99,7 @@@ git tag -m "annotated tag" --create-reflog tag_with_reflog && git reflog exists refs/tags/tag_with_reflog && sed -e "s/^.* //" .git/logs/refs/tags/tag_with_reflog >actual && - test_cmp expected actual + test_i18ncmp expected actual ' test_expect_success '--create-reflog does not create reflog on failure' ' @@@ -935,16 -934,18 +935,16 @@@ test_expect_success GPG 'verifying a fo test_must_fail git tag -v forged-tag ' -test_expect_success 'verifying a proper tag with --format pass and format accordingly' ' - cat >expect <<-\EOF +test_expect_success GPG 'verifying a proper tag with --format pass and format accordingly' ' + cat >expect <<-\EOF && tagname : signed-tag - EOF && + EOF git tag -v --format="tagname : %(tag)" "signed-tag" >actual && test_cmp expect actual ' -test_expect_success 'verifying a forged tag with --format fail and format accordingly' ' - cat >expect <<-\EOF - tagname : forged-tag - EOF && +test_expect_success GPG 'verifying a forged tag with --format should fail silently' ' + >expect && test_must_fail git tag -v --format="tagname : %(tag)" "forged-tag" >actual && test_cmp expect actual ' @@@ -1888,7 -1889,7 +1888,7 @@@ EOF run_with_limited_stack git tag --contains HEAD >actual && test_cmp expect actual && run_with_limited_stack git tag --no-contains HEAD >actual && - test_line_count ">" 10 actual + test_line_count "-gt" 10 actual ' test_expect_success '--format should list tags as per format given' ' @@@ -1901,30 -1902,6 +1901,30 @@@ test_cmp expect actual ' +test_expect_success "set up color tests" ' + echo "v1.0" >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 && + 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 && + 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 && + test_cmp expect.color actual +' + test_expect_success 'setup --merged test tags' ' git tag mergetest-1 HEAD~2 && git tag mergetest-2 HEAD~1 &&