Git fork

Merge branch 'mh/doc-credential-url-prefix'

Doc update to describe a feature that has already been implemented.

* mh/doc-credential-url-prefix:
docs/gitcredentials: describe URL prefix matching

+22 -12
+7 -8
Documentation/gitcredentials.adoc
··· 150 150 username = foo 151 151 -------------------------------------- 152 152 153 - then we will match: both protocols are the same, both hosts are the same, and 154 - the "pattern" URL does not care about the path component at all. However, this 155 - context would not match: 153 + then we will match: both protocols are the same and both hosts are the same. 154 + However, this context would not match: 156 155 157 156 -------------------------------------- 158 157 [credential "https://kernel.org"] ··· 166 165 the domain name and other pattern matching techniques as with the `http.<URL>.*` 167 166 options. 168 167 169 - If the "pattern" URL does include a path component, then this too must match 170 - exactly: the context `https://example.com/bar/baz.git` will match a config 171 - entry for `https://example.com/bar/baz.git` (in addition to matching the config 172 - entry for `https://example.com`) but will not match a config entry for 173 - `https://example.com/bar`. 168 + If the "pattern" URL does include a path component, then this must match 169 + as a prefix path: the context `https://example.com/bar` will match a config 170 + entry for `https://example.com/bar/baz.git` but will not match a config entry for 171 + `https://example.com/other/repo.git` or `https://example.com/barry/repo.git` 172 + (even though it is a string prefix). 174 173 175 174 176 175 CONFIGURATION OPTIONS
+15 -4
t/t0300-credentials.sh
··· 991 991 992 992 test_expect_success 'credential config with partial URLs' ' 993 993 echo "echo password=yep" | write_script git-credential-yep && 994 - test_write_lines url=https://user@example.com/repo.git >stdin && 994 + test_write_lines url=https://user@example.com/org/repo.git >stdin && 995 995 for partial in \ 996 996 example.com \ 997 + example.com/org/repo.git \ 997 998 user@example.com \ 999 + user@example.com/org/repo.git \ 998 1000 https:// \ 999 1001 https://example.com \ 1000 1002 https://example.com/ \ 1003 + https://example.com/org \ 1004 + https://example.com/org/ \ 1005 + https://example.com/org/repo.git \ 1001 1006 https://user@example.com \ 1002 1007 https://user@example.com/ \ 1003 - https://example.com/repo.git \ 1004 - https://user@example.com/repo.git \ 1005 - /repo.git 1008 + https://user@example.com/org \ 1009 + https://user@example.com/org/ \ 1010 + https://user@example.com/org/repo.git \ 1011 + /org/repo.git 1006 1012 do 1007 1013 git -c credential.$partial.helper=yep \ 1008 1014 credential fill <stdin >stdout && ··· 1012 1018 1013 1019 for partial in \ 1014 1020 dont.use.this \ 1021 + example.com/o \ 1022 + user@example.com/o \ 1015 1023 http:// \ 1024 + https://example.com/o \ 1025 + https://user@example.com/o \ 1026 + /o \ 1016 1027 /repo 1017 1028 do 1018 1029 git -c credential.$partial.helper=yep \