[PATCH v4 4/4] credential-store: make sure there is no regression with missing scheme
- From
Carlo Marcelo Arenas Belón <carenas@gmail.com>
- Date
- Apr 28, 2020, 10:52 UTC
- Message-ID
- <20200428105254.28658-4-carenas@gmail.com>
- In-Reply-To
- <20200428105254.28658-1-carenas@gmail.com>
c44088ecc4 (credential: treat URL without scheme as invalid, 2020-04-18) made scheme (AKA protocol) mandatory so make sure that still fails.
Suggested-by: Jeff King <peff@peff.net> Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com> --- t/t0302-credential-store.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/t/t0302-credential-store.sh b/t/t0302-credential-store.sh index 4e5a73cb99..7c7a48303f 100755 --- a/t/t0302-credential-store.sh +++ b/t/t0302-credential-store.sh @@ -135,4 +135,21 @@ test_expect_success 'get: store file can contain empty/bogus lines' ' EOF ' +test_expect_success 'get: ignore credentials without scheme' ' + echo "://user:pass@example.com" >"$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_done
-- 2.26.2.569.g1d74ac4d14