summaryrefslogtreecommitdiff
path: root/t/t6302-for-each-ref-filter.sh
diff options
context:
space:
mode:
authorKarthik Nayak <karthik.188@gmail.com>2015-09-11 14:59:47 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-09-17 17:02:48 (GMT)
commit40a7551d25efac7979ee1a675c05e67313205444 (patch)
tree3e5573b8f264463ead90ecfe82760e7b7386e9f4 /t/t6302-for-each-ref-filter.sh
parent63d89fbce11c358ab73bdbb0d36919a454b2f5a6 (diff)
downloadgit-40a7551d25efac7979ee1a675c05e67313205444.zip
git-40a7551d25efac7979ee1a675c05e67313205444.tar.gz
git-40a7551d25efac7979ee1a675c05e67313205444.tar.bz2
ref-filter: introduce match_atom_name()
Introduce match_atom_name() which helps in checking if a particular atom is the atom we're looking for and if it has a value attached to it or not. Use it instead of starts_with() for checking the value of %(color:...) atom. Write a test for the same. Mentored-by: Christian Couder <christian.couder@gmail.com> Mentored-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Thanks-to: Junio C Hamano <gitster@pobox.com> Signed-off-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6302-for-each-ref-filter.sh')
-rwxr-xr-xt/t6302-for-each-ref-filter.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/t/t6302-for-each-ref-filter.sh b/t/t6302-for-each-ref-filter.sh
index 505a360..c4f0378 100755
--- a/t/t6302-for-each-ref-filter.sh
+++ b/t/t6302-for-each-ref-filter.sh
@@ -81,4 +81,8 @@ test_expect_success 'filtering with --contains' '
test_cmp expect actual
'
+test_expect_success '%(color) must fail' '
+ test_must_fail git for-each-ref --format="%(color)%(refname)"
+'
+
test_done