summaryrefslogtreecommitdiff
path: root/t/t6300-for-each-ref.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-02-07 19:50:34 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-02-07 19:50:34 (GMT)
commit44a6b6ce1777f587c318008fe59b901a296f5326 (patch)
treed8c5f7d58fb7efc1705fcf0ff55d1cdc92868ea0 /t/t6300-for-each-ref.sh
parent3d9e4ce3ebef4f5aa47dad49f730e085f32b98da (diff)
downloadgit-44a6b6ce1777f587c318008fe59b901a296f5326.zip
git-44a6b6ce1777f587c318008fe59b901a296f5326.tar.gz
git-44a6b6ce1777f587c318008fe59b901a296f5326.tar.bz2
ref-filter: resurrect "strip" as a synonym to "lstrip"
We forgot that "strip" was introduced at 0571979bd6 ("tag: do not show ambiguous tag names as "tags/foo"", 2016-01-25) as part of Git 2.8 (and 2.7.1) when we started calling this "lstrip" to make it easier to explain the new "rstrip" operation. We shouldn't have renamed the existing one; "lstrip" should have been a new synonym that means the same thing as "strip". Scripts in the wild are surely using the original form already. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6300-for-each-ref.sh')
-rwxr-xr-xt/t6300-for-each-ref.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh
index 25a9973..c87dc1f 100755
--- a/t/t6300-for-each-ref.sh
+++ b/t/t6300-for-each-ref.sh
@@ -59,18 +59,26 @@ test_atom head refname:rstrip=1 refs/heads
test_atom head refname:rstrip=2 refs
test_atom head refname:rstrip=-1 refs
test_atom head refname:rstrip=-2 refs/heads
+test_atom head refname:strip=1 heads/master
+test_atom head refname:strip=2 master
+test_atom head refname:strip=-1 master
+test_atom head refname:strip=-2 heads/master
test_atom head upstream refs/remotes/origin/master
test_atom head upstream:short origin/master
test_atom head upstream:lstrip=2 origin/master
test_atom head upstream:lstrip=-2 origin/master
test_atom head upstream:rstrip=2 refs/remotes
test_atom head upstream:rstrip=-2 refs/remotes
+test_atom head upstream:strip=2 origin/master
+test_atom head upstream:strip=-2 origin/master
test_atom head push refs/remotes/myfork/master
test_atom head push:short myfork/master
test_atom head push:lstrip=1 remotes/myfork/master
test_atom head push:lstrip=-1 master
test_atom head push:rstrip=1 refs/remotes/myfork
test_atom head push:rstrip=-1 refs
+test_atom head push:strip=1 remotes/myfork/master
+test_atom head push:strip=-1 master
test_atom head objecttype commit
test_atom head objectsize 171
test_atom head objectname $(git rev-parse refs/heads/master)
@@ -636,6 +644,10 @@ EOF
test_expect_success 'Verify usage of %(symref:lstrip) atom' '
git for-each-ref --format="%(symref:lstrip=2)" refs/heads/sym > actual &&
git for-each-ref --format="%(symref:lstrip=-2)" refs/heads/sym >> actual &&
+ test_cmp expected actual &&
+
+ git for-each-ref --format="%(symref:strip=2)" refs/heads/sym > actual &&
+ git for-each-ref --format="%(symref:strip=-2)" refs/heads/sym >> actual &&
test_cmp expected actual
'