diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh index 4620f0ca7f..b45879a760 100755 --- a/t/t5510-fetch.sh +++ b/t/t5510-fetch.sh @@ -853,7 +853,11 @@ test_configured_prune_type () { then new_cmdline=$cmdline_setup else - new_cmdline=$(printf "%s" "$cmdline" | perl -pe 's[origin(?!/)]["'"$remote_url"'"]g') + new_cmdline=$(perl -e ' + my ($cmdline, $url) = @ARGV; + $cmdline =~ s[origin(?!/)][quotemeta($url)]ge; + print $cmdline; + ' -- "$cmdline" "$remote_url") fi if test "$fetch_prune_tags" = 'true' ||