summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2010-05-23 05:19:44 -0400
committerJunio C Hamano <gitster@pobox.com>2010-05-24 16:48:34 -0700
commit9d2e942070b235e1f4a0b8dd4c55a6b3f0fe914a (patch)
tree9b5415483a8e35198ab92e188cc98230f8966baf /t
parent638794cde08bb785410a92d293969949a1f5a846 (diff)
downloadgit-9d2e942070b235e1f4a0b8dd4c55a6b3f0fe914a.tar.gz
decode file:// and ssh:// URLs
We generally treat these as equivalent to "/path/to/repo" and "host:path_to_repo" respectively. However, they are URLs and as such may be percent-encoded. The current code simply uses them as-is without any decoding. With this patch, we will now percent-decode any file:// or ssh:// url (or ssh+git, git+ssh, etc) at the transport layer. We continue to treat plain paths and "host:path" syntax literally. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t5601-clone.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index 678cee502d..8abb71afcd 100755
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
@@ -176,4 +176,16 @@ test_expect_success 'clone respects global branch.autosetuprebase' '
)
'
+test_expect_success 'respect url-encoding of file://' '
+ git init x+y &&
+ test_must_fail git clone "file://$PWD/x+y" xy-url &&
+ git clone "file://$PWD/x%2By" xy-url
+'
+
+test_expect_success 'do not respect url-encoding of non-url path' '
+ git init x+y &&
+ test_must_fail git clone x%2By xy-regular &&
+ git clone x+y xy-regular
+'
+
test_done