summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-05-05 21:54:26 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-05-05 21:54:26 (GMT)
commitfd65fc3960a972ab2f03b94d08f0e421d9ee22bb (patch)
tree05661137277959a67079a9f8fd43bde7e83b92fa /t
parentb34789c0b0d3b137f0bb516b417bd8d75e0cb306 (diff)
parentb44d0118ac5074215ece7ae2bb86ad0713f70674 (diff)
downloadgit-fd65fc3960a972ab2f03b94d08f0e421d9ee22bb.zip
git-fd65fc3960a972ab2f03b94d08f0e421d9ee22bb.tar.gz
git-fd65fc3960a972ab2f03b94d08f0e421d9ee22bb.tar.bz2
Merge branch 'bc/wildcard-credential'
Update the parser used for credential.<URL>.<variable> configuration, to handle <URL>s with '/' in them correctly. * bc/wildcard-credential: credential: fix matching URLs with multiple levels in path
Diffstat (limited to 't')
-rwxr-xr-xt/t0300-credentials.sh45
1 files changed, 45 insertions, 0 deletions
diff --git a/t/t0300-credentials.sh b/t/t0300-credentials.sh
index 48484cb..91a007f 100755
--- a/t/t0300-credentials.sh
+++ b/t/t0300-credentials.sh
@@ -366,6 +366,51 @@ test_expect_success 'match percent-encoded values' '
EOF
'
+test_expect_success 'match percent-encoded UTF-8 values in path' '
+ test_config credential.https://example.com.useHttpPath true &&
+ test_config credential.https://example.com/perĂº.git.helper "$HELPER" &&
+ check fill <<-\EOF
+ url=https://example.com/per%C3%BA.git
+ --
+ protocol=https
+ host=example.com
+ path=perĂº.git
+ username=foo
+ password=bar
+ --
+ EOF
+'
+
+test_expect_success 'match percent-encoded values in username' '
+ test_config credential.https://user%2fname@example.com/foo/bar.git.helper "$HELPER" &&
+ check fill <<-\EOF
+ url=https://user%2fname@example.com/foo/bar.git
+ --
+ protocol=https
+ host=example.com
+ username=foo
+ password=bar
+ --
+ EOF
+'
+
+test_expect_success 'fetch with multiple path components' '
+ test_unconfig credential.helper &&
+ test_config credential.https://example.com/foo/repo.git.helper "verbatim foo bar" &&
+ check fill <<-\EOF
+ url=https://example.com/foo/repo.git
+ --
+ protocol=https
+ host=example.com
+ username=foo
+ password=bar
+ --
+ verbatim: get
+ verbatim: protocol=https
+ verbatim: host=example.com
+ EOF
+'
+
test_expect_success 'pull username from config' '
test_config credential.https://example.com.username foo &&
check fill <<-\EOF