t0302: check helper can handle empty credentials

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>

Jakub Bereżański committed Oct 30, 2017 at 18:20 UTC 3c90bda688afe55eb2c99a1ea1486ebc6bb48ca6
1 file changed +19
t/lib-credential.sh
+19
@@ -44,6 +44,7 @@ helper_test_clean() {
44 reject $1 https example.com user2
45 reject $1 http path.tld user
46 reject $1 https timeout.tld user
47 + reject $1 https sso.tld
48 }
49
50 reject() {
@@ -250,6 +251,24 @@ helper_test() {
251 password=pass2
252 EOF
253 '
254 +
255 + test_expect_success "helper ($HELPER) can store empty username" '
256 + check approve $HELPER <<-\EOF &&
257 + protocol=https
258 + host=sso.tld
259 + username=
260 + password=
261 + EOF
262 + check fill $HELPER <<-\EOF
263 + protocol=https
264 + host=sso.tld
265 + --
266 + protocol=https
267 + host=sso.tld
268 + username=
269 + password=
270 + EOF
271 + '
272 }
273
274 helper_test_timeout() {