aboutsummaryrefslogtreecommitdiffstats
path: root/t/t0300-credentials.sh
diff options
context:
space:
mode:
authorM Hickford <mirth.hickford@gmail.com>2025-10-01 20:56:49 +0000
committerJunio C Hamano <gitster@pobox.com>2025-10-01 14:23:51 -0700
commitfdd21ba116551efb07e784f138d090917b7e70ad (patch)
tree9f483bfb4666bebbac1764a571a37b11a5887558 /t/t0300-credentials.sh
parentMerge branch 'maint-2.47' into maint-2.48 (diff)
downloadgit-fdd21ba116551efb07e784f138d090917b7e70ad.tar.gz
git-fdd21ba116551efb07e784f138d090917b7e70ad.zip
docs/gitcredentials: describe URL prefix matching
Documentation was inaccurate since 9a121b0d226 (credential: handle `credential.<partial-URL>.<key>` again, 2020-04-24) Add tests for documented behaviour. Signed-off-by: M Hickford <mirth.hickford@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to '')
-rwxr-xr-xt/t0300-credentials.sh19
1 files changed, 15 insertions, 4 deletions
diff --git a/t/t0300-credentials.sh b/t/t0300-credentials.sh
index cb3a85c7ff..07aa834d33 100755
--- a/t/t0300-credentials.sh
+++ b/t/t0300-credentials.sh
@@ -991,18 +991,24 @@ test_expect_success 'url parser not confused by encoded markers' '
test_expect_success 'credential config with partial URLs' '
echo "echo password=yep" | write_script git-credential-yep &&
- test_write_lines url=https://user@example.com/repo.git >stdin &&
+ test_write_lines url=https://user@example.com/org/repo.git >stdin &&
for partial in \
example.com \
+ example.com/org/repo.git \
user@example.com \
+ user@example.com/org/repo.git \
https:// \
https://example.com \
https://example.com/ \
+ https://example.com/org \
+ https://example.com/org/ \
+ https://example.com/org/repo.git \
https://user@example.com \
https://user@example.com/ \
- https://example.com/repo.git \
- https://user@example.com/repo.git \
- /repo.git
+ https://user@example.com/org \
+ https://user@example.com/org/ \
+ https://user@example.com/org/repo.git \
+ /org/repo.git
do
git -c credential.$partial.helper=yep \
credential fill <stdin >stdout &&
@@ -1012,7 +1018,12 @@ test_expect_success 'credential config with partial URLs' '
for partial in \
dont.use.this \
+ example.com/o \
+ user@example.com/o \
http:// \
+ https://example.com/o \
+ https://user@example.com/o \
+ /o \
/repo
do
git -c credential.$partial.helper=yep \