aboutsummaryrefslogtreecommitdiff
path: root/t/t7004-tag.sh
diff options
context:
space:
mode:
authorKarthik Nayak <karthik.188@gmail.com>2015-09-11 20:36:16 +0530
committerJunio C Hamano <gitster@pobox.com>2015-09-17 10:02:49 -0700
commitb7cc53e92c806b73e14b03f60c17b7c29e52b4a4 (patch)
tree476b544dc35d3eea557665aec0db22d1d7b75778 /t/t7004-tag.sh
parentac4cc866c8cddbc25b5f213286a0269318dd2485 (diff)
downloadgit-b7cc53e92c806b73e14b03f60c17b7c29e52b4a4.tar.gz
git-b7cc53e92c806b73e14b03f60c17b7c29e52b4a4.tar.xz
tag.c: use 'ref-filter' APIs
Make 'tag.c' use 'ref-filter' APIs for iterating through refs, sorting and printing of refs. This removes most of the code used in 'tag.c' replacing it with calls to the 'ref-filter' library. Make 'tag.c' use the 'filter_refs()' function provided by 'ref-filter' to filter out tags based on the options set. For printing tags we use 'show_ref_array_item()' function provided by 'ref-filter'. We improve the sorting option provided by 'tag.c' by using the sorting options provided by 'ref-filter'. This causes the test 'invalid sort parameter on command line' in t7004 to fail, as 'ref-filter' throws an error for all sorting fields which are incorrect. The test is changed to reflect the same. Modify 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/t7004-tag.sh')
-rwxr-xr-xt/t7004-tag.sh8
1 files changed, 1 insertions, 7 deletions
diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index d31788cc6..84153efb0 100755
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
@@ -1462,13 +1462,7 @@ test_expect_success 'invalid sort parameter on command line' '
test_expect_success 'invalid sort parameter in configuratoin' '
git config tag.sort "v:notvalid" &&
- git tag -l "foo*" >actual &&
- cat >expect <<-\EOF &&
- foo1.10
- foo1.3
- foo1.6
- EOF
- test_cmp expect actual
+ test_must_fail git tag -l "foo*"
'
test_expect_success 'version sort with prerelease reordering' '