t5550: break submodule config test into multiple sub-tests

Right now we test only the cloning case, but there are other interesting cases (e.g., fetching). Let's pull the setup bits into their own test, which will make things flow more logically once we start adding more tests which use the setup. Let's also introduce some whitespace to the clone-test to split the two parts: making sure it fails without our cmdline config, and that it succeeds with it. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Apr 28, 2016 at 09:37 UTC 455d22c1c6abc19693beb8a25bc3d976290d6b84
1 file changed +6 -2
t/t5550-http-fetch-dumb.sh
+6 -2
@@ -91,17 +91,21 @@ test_expect_success 'configured username does not override URL' '
91 expect_askpass pass user@host
92 '
93
94 -test_expect_success 'cmdline credential config passes into submodules' '
94 +test_expect_success 'set up repo with http submodules' '
95 git init super &&
96 set_askpass user@host pass@host &&
97 (
98 cd super &&
99 git submodule add "$HTTPD_URL/auth/dumb/repo.git" sub &&
100 git commit -m "add submodule"
101 - ) &&
101 + )
102 +'
103 +
104 +test_expect_success 'cmdline credential config passes to submodule via clone' '
105 set_askpass wrong pass@host &&
106 test_must_fail git clone --recursive super super-clone &&
107 rm -rf super-clone &&
108 +
109 set_askpass wrong pass@host &&
110 git -c "credential.$HTTPD_URL.username=user@host" \
111 clone --recursive super super-clone &&