summaryrefslogtreecommitdiff
path: root/t/t6300-for-each-ref.sh
diff options
context:
space:
mode:
authorKarthik Nayak <karthik.188@gmail.com>2017-01-10 08:49:47 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-01-10 20:44:31 (GMT)
commit3a42980f9e5ecc2b74c538109d4007c630881f1c (patch)
treef02610e5d0e5e981003ccf67c317c63947b62bd0 /t/t6300-for-each-ref.sh
parent17938f171f703c28696c7839a910565f0fb32121 (diff)
downloadgit-3a42980f9e5ecc2b74c538109d4007c630881f1c.zip
git-3a42980f9e5ecc2b74c538109d4007c630881f1c.tar.gz
git-3a42980f9e5ecc2b74c538109d4007c630881f1c.tar.bz2
ref-filter: Do not abruptly die when using the 'lstrip=<N>' option
Currently when we use the 'lstrip=<N>' option, if 'N' is greater than the number of components available in the refname, we abruptly end program execution by calling die(). This behavior is undesired since a single refname with few components could end program execution. To avoid this, return an empty string whenever the value 'N' is greater than the number of components available, instead of calling die(). Signed-off-by: Karthik Nayak <Karthik.188@gmail.com> 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.sh4
1 files changed, 0 insertions, 4 deletions
diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh
index 5eb013c..d3d1a97 100755
--- a/t/t6300-for-each-ref.sh
+++ b/t/t6300-for-each-ref.sh
@@ -147,10 +147,6 @@ test_expect_success 'arguments to :lstrip must be positive integers' '
test_must_fail git for-each-ref --format="%(refname:lstrip=foo)"
'
-test_expect_success 'stripping refnames too far gives an error' '
- test_must_fail git for-each-ref --format="%(refname:lstrip=3)"
-'
-
test_expect_success 'Check format specifiers are ignored in naming date atoms' '
git for-each-ref --format="%(authordate)" refs/heads &&
git for-each-ref --format="%(authordate:default) %(authordate)" refs/heads &&