merge(3p/git): Merge git subtree at v2.29.2
This also bumps the stable nixpkgs to 20.09 as of 2020-11-21, because there is some breakage in the git build related to the netrc credentials helper which someone has taken care of in nixpkgs. The stable channel is not used for anything other than git, so this should be fine. Change-Id: I3575a19dab09e1e9556cf8231d717de9890484fb
This commit is contained in:
parent
082c006c04
commit
f4609b896f
1485 changed files with 241535 additions and 109418 deletions
91
third_party/git/t/t0302-credential-store.sh
vendored
91
third_party/git/t/t0302-credential-store.sh
vendored
|
|
@ -107,7 +107,6 @@ test_expect_success 'store: if both xdg and home files exist, only store in home
|
|||
test_must_be_empty "$HOME/.config/git/credentials"
|
||||
'
|
||||
|
||||
|
||||
test_expect_success 'erase: erase matching credentials from both xdg and home files' '
|
||||
echo "https://home-user:home-pass@example.com" >"$HOME/.git-credentials" &&
|
||||
mkdir -p "$HOME/.config/git" &&
|
||||
|
|
@ -120,4 +119,94 @@ test_expect_success 'erase: erase matching credentials from both xdg and home fi
|
|||
test_must_be_empty "$HOME/.config/git/credentials"
|
||||
'
|
||||
|
||||
invalid_credential_test() {
|
||||
test_expect_success "get: ignore credentials without $1 as invalid" '
|
||||
echo "$2" >"$HOME/.git-credentials" &&
|
||||
check fill store <<-\EOF
|
||||
protocol=https
|
||||
host=example.com
|
||||
--
|
||||
protocol=https
|
||||
host=example.com
|
||||
username=askpass-username
|
||||
password=askpass-password
|
||||
--
|
||||
askpass: Username for '\''https://example.com'\'':
|
||||
askpass: Password for '\''https://askpass-username@example.com'\'':
|
||||
--
|
||||
EOF
|
||||
'
|
||||
}
|
||||
|
||||
invalid_credential_test "scheme" ://user:pass@example.com
|
||||
invalid_credential_test "valid host/path" https://user:pass@
|
||||
invalid_credential_test "username/password" https://pass@example.com
|
||||
|
||||
test_expect_success 'get: credentials with DOS line endings are invalid' '
|
||||
printf "https://user:pass@example.com\r\n" >"$HOME/.git-credentials" &&
|
||||
check fill store <<-\EOF
|
||||
protocol=https
|
||||
host=example.com
|
||||
--
|
||||
protocol=https
|
||||
host=example.com
|
||||
username=askpass-username
|
||||
password=askpass-password
|
||||
--
|
||||
askpass: Username for '\''https://example.com'\'':
|
||||
askpass: Password for '\''https://askpass-username@example.com'\'':
|
||||
--
|
||||
EOF
|
||||
'
|
||||
|
||||
test_expect_success 'get: credentials with path and DOS line endings are valid' '
|
||||
printf "https://user:pass@example.com/repo.git\r\n" >"$HOME/.git-credentials" &&
|
||||
check fill store <<-\EOF
|
||||
url=https://example.com/repo.git
|
||||
--
|
||||
protocol=https
|
||||
host=example.com
|
||||
username=user
|
||||
password=pass
|
||||
--
|
||||
EOF
|
||||
'
|
||||
|
||||
test_expect_success 'get: credentials with DOS line endings are invalid if path is relevant' '
|
||||
printf "https://user:pass@example.com/repo.git\r\n" >"$HOME/.git-credentials" &&
|
||||
test_config credential.useHttpPath true &&
|
||||
check fill store <<-\EOF
|
||||
url=https://example.com/repo.git
|
||||
--
|
||||
protocol=https
|
||||
host=example.com
|
||||
path=repo.git
|
||||
username=askpass-username
|
||||
password=askpass-password
|
||||
--
|
||||
askpass: Username for '\''https://example.com/repo.git'\'':
|
||||
askpass: Password for '\''https://askpass-username@example.com/repo.git'\'':
|
||||
--
|
||||
EOF
|
||||
'
|
||||
|
||||
test_expect_success 'get: store file can contain empty/bogus lines' '
|
||||
echo "" >"$HOME/.git-credentials" &&
|
||||
q_to_tab <<-\CREDENTIAL >>"$HOME/.git-credentials" &&
|
||||
#comment
|
||||
Q
|
||||
https://user:pass@example.com
|
||||
CREDENTIAL
|
||||
check fill store <<-\EOF
|
||||
protocol=https
|
||||
host=example.com
|
||||
--
|
||||
protocol=https
|
||||
host=example.com
|
||||
username=user
|
||||
password=pass
|
||||
--
|
||||
EOF
|
||||
'
|
||||
|
||||
test_done
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue