diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-02-20 12:15:28 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-02-20 12:15:28 +0400 |
commit | 76bdcf0ee31afc020df104a4997ffae2a72ca302 (patch) | |
tree | aba14de61b510a66498e7318bef35578f1ab04bf /t/t7004-tag.sh | |
parent | 8c60fcbcfd39390c0fbf3d49974bf0029ef4d9c6 (diff) | |
parent | 0975a5020ef050a9fd5b518cbd601e5ee43ddbcf (diff) |
Merge branch 'tg/tag-points-at'
* tg/tag-points-at:
builtin/tag.c: Fix a sparse warning
tag: add --points-at list option
Diffstat (limited to 't/t7004-tag.sh')
-rwxr-xr-x | t/t7004-tag.sh | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh index 4ef79aabc4..f8c247a750 100755 --- a/t/t7004-tag.sh +++ b/t/t7004-tag.sh @@ -1282,4 +1282,43 @@ test_expect_success 'mixing incompatibles modes and options is forbidden' ' test_must_fail git tag -v -s ' +# check points-at + +test_expect_success '--points-at cannot be used in non-list mode' ' + test_must_fail git tag --points-at=v4.0 foo +' + +test_expect_success '--points-at finds lightweight tags' ' + echo v4.0 >expect && + git tag --points-at v4.0 >actual && + test_cmp expect actual +' + +test_expect_success '--points-at finds annotated tags of commits' ' + git tag -m "v4.0, annotated" annotated-v4.0 v4.0 && + echo annotated-v4.0 >expect && + git tag -l --points-at v4.0 "annotated*" >actual && + test_cmp expect actual +' + +test_expect_success '--points-at finds annotated tags of tags' ' + git tag -m "describing the v4.0 tag object" \ + annotated-again-v4.0 annotated-v4.0 && + cat >expect <<-\EOF && + annotated-again-v4.0 + annotated-v4.0 + EOF + git tag --points-at=annotated-v4.0 >actual && + test_cmp expect actual +' + +test_expect_success 'multiple --points-at are OR-ed together' ' + cat >expect <<-\EOF && + v2.0 + v3.0 + EOF + git tag --points-at=v2.0 --points-at=v3.0 >actual && + test_cmp expect actual +' + test_done |