diff options
author | Karthik Nayak <karthik.188@gmail.com> | 2015-09-11 20:36:46 +0530 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-09-17 10:02:49 -0700 |
commit | df0947417acd1058c17e2bf20374497f33084549 (patch) | |
tree | 99dbad97bb320bed4fc87cc94bde6b807d1d581a /t | |
parent | b7cc53e92c806b73e14b03f60c17b7c29e52b4a4 (diff) | |
download | git-df0947417acd1058c17e2bf20374497f33084549.tar.gz |
tag.c: implement '--format' option
Implement the '--format' option provided by 'ref-filter'.
This lets the user list tags as per desired format similar
to the implementation in 'git for-each-ref'.
Add tests and documentation for the same.
Mentored-by: Christian Couder <christian.couder@gmail.com>
Mentored-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t7004-tag.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh index 84153efb03..8987fb160d 100755 --- a/t/t7004-tag.sh +++ b/t/t7004-tag.sh @@ -1519,4 +1519,16 @@ EOF" test_cmp expect actual ' +test_expect_success '--format should list tags as per format given' ' + cat >expect <<-\EOF && + refname : refs/tags/foo1.10 + refname : refs/tags/foo1.3 + refname : refs/tags/foo1.6 + refname : refs/tags/foo1.6-rc1 + refname : refs/tags/foo1.6-rc2 + EOF + git tag -l --format="refname : %(refname)" "foo*" >actual && + test_cmp expect actual +' + test_done |