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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxx>
Signed-off-by: Carlo Marcelo Arenas Belón <carenas@xxxxxxxxx>
---
 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@xxxxxxxxxxx" >"$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@xxxxxxxxxxx'\'':
+	--
+	EOF
+'
+
 test_done
-- 
2.26.2.569.g1d74ac4d14




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux