Subject: [PATCH v4 4/4] credential-store: make sure there is no regression with missing scheme

From: Carlo Marcelo Arenas Belón <[email-masked]>
Date: Tue, 28 Apr 2020 03:52:54 -0700

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 <[email-masked]>
Signed-off-by: Carlo Marcelo Arenas Belón <[email-masked]>
---
 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:[email-masked]" >"$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://[email-masked]'\'':
+	--
+	EOF
+'
+
 test_done
-- 
2.26.2.569.g1d74ac4d14