]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t0302: check helper can handle empty credentials
authorJakub Bereżański <kuba@berezanscy.pl>
Mon, 30 Oct 2017 17:20:12 +0000 (18:20 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 1 Nov 2017 04:46:39 +0000 (13:46 +0900)
Make sure the helper does not crash when blank username and password is
provided. If the helper can save such credentials, it should be able to
read them back.

Signed-off-by: Jakub Bereżański <kuba@berezanscy.pl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/lib-credential.sh

index d8e41f7ddd155b9f2861f55ab97943fed28968e7..937b831ea675230c1e0fbe8ba7ebb3004de71b3b 100755 (executable)
@@ -44,6 +44,7 @@ helper_test_clean() {
        reject $1 https example.com user2
        reject $1 http path.tld user
        reject $1 https timeout.tld user
+       reject $1 https sso.tld
 }
 
 reject() {
@@ -250,6 +251,24 @@ helper_test() {
                password=pass2
                EOF
        '
+
+       test_expect_success "helper ($HELPER) can store empty username" '
+               check approve $HELPER <<-\EOF &&
+               protocol=https
+               host=sso.tld
+               username=
+               password=
+               EOF
+               check fill $HELPER <<-\EOF
+               protocol=https
+               host=sso.tld
+               --
+               protocol=https
+               host=sso.tld
+               username=
+               password=
+               EOF
+       '
 }
 
 helper_test_timeout() {