aboutsummaryrefslogtreecommitdiffstats
path: root/t/t7416-submodule-dash-url.sh
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-04-03 07:06:02 +0200
committerJunio C Hamano <gitster@pobox.com>2025-04-07 14:47:39 -0700
commitcdbdc6bf8caddc32e5fae7bfe4a63c54be21093f (patch)
tree4ff7685e733a340dc1bd3e88e57c483b62f27efb /t/t7416-submodule-dash-url.sh
parentdb8ff64a3a5244b44e27e0d46a48a304a2e36456 (diff)
downloadgit-cdbdc6bf8caddc32e5fae7bfe4a63c54be21093f.tar.gz
t: refactor tests depending on Perl substitution operator
We have a bunch of tests that use Perl to perform substitution via the "s/" operator. These usecases can be trivially replaced with sed(1) and tr(1). Refactor the tests accordingly so that we can drop a couple of PERL_TEST_HELPERS prerequisites. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7416-submodule-dash-url.sh')
-rwxr-xr-xt/t7416-submodule-dash-url.sh9
1 files changed, 2 insertions, 7 deletions
diff --git a/t/t7416-submodule-dash-url.sh b/t/t7416-submodule-dash-url.sh
index 14069600a2..3d944a00e0 100755
--- a/t/t7416-submodule-dash-url.sh
+++ b/t/t7416-submodule-dash-url.sh
@@ -4,12 +4,6 @@ test_description='check handling of disallowed .gitmodule urls'
. ./test-lib.sh
-if ! test_have_prereq PERL_TEST_HELPERS
-then
- skip_all='skipping submodule dash URL tests; Perl not available'
- test_done
-fi
-
test_expect_success 'setup' '
git config --global protocol.file.allow always
'
@@ -39,7 +33,8 @@ test_expect_success 'fsck accepts protected dash' '
'
test_expect_success 'remove ./ protection from .gitmodules url' '
- perl -i -pe "s{\./}{}" .gitmodules &&
+ sed "s|\./||" .gitmodules >.gitmodules.munged &&
+ mv .gitmodules.munged .gitmodules &&
git commit -am "drop protection"
'