summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Karthik Nayak <karthik.188@gmail.com>2017-01-10 14:19:44 +0530
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-01-10 12:44:31 -0800
commita7984101846ccfb8837526a8d79dda5b8c461d84 (patch)
tree8cdc88b4679d32aa84e673d1f236bc45e6149946 /t
parentref-filter: introduce refname_atom_parser_internal() (diff)
downloadtgif-a7984101846ccfb8837526a8d79dda5b8c461d84.tar.xz
ref-filter: introduce refname_atom_parser()
Using refname_atom_parser_internal(), introduce refname_atom_parser() which will parse the %(symref) and %(refname) atoms. Store the parsed information into the 'used_atom' structure based on the modifiers used along with the atoms. Now the '%(symref)' atom supports the ':strip' atom modifier. Update the Documentation and tests to reflect this. Helped-by: Jeff King <peff@peff.net> Signed-off-by: Karthik Nayak <Karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t6300-for-each-ref.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh
index 7663a3661f..18a9e2565c 100755
--- a/t/t6300-for-each-ref.sh
+++ b/t/t6300-for-each-ref.sh
@@ -624,4 +624,13 @@ test_expect_success 'Verify usage of %(symref:short) atom' '
test_cmp expected actual
'
+cat >expected <<EOF
+master
+EOF
+
+test_expect_success 'Verify usage of %(symref:strip) atom' '
+ git for-each-ref --format="%(symref:strip=2)" refs/heads/sym > actual &&
+ test_cmp expected actual
+'
+
test_done