submodule: ensure that -c http.extraheader is heeded
To support this developer's use case of allowing build agents token-based access to private repositories, we introduced the http.extraheader feature, allowing extra HTTP headers to be sent along with every HTTP request. This patch verifies that we can configure these extra HTTP headers via the command-line for use with `git submodule update`, too. Example: git -c http.extraheader="Secret: Sauce" submodule update --init Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin committed
May 10, 2016 at 09:08 UTC
0bbe731714e0042888eb99a8ff3f4cdf245ffce6
1 file changed
+10
-1
t/t5551-http-fetch-smart.sh
+10
-1
@@ -287,7 +287,16 @@ test_expect_success 'custom http headers' '
287
fetch "$HTTPD_URL/smart_headers/repo.git" &&
288
git -c http.extraheader="x-magic-one: abra" \
289
-c http.extraheader="x-magic-two: cadabra" \
290
- fetch "$HTTPD_URL/smart_headers/repo.git"
290
+ fetch "$HTTPD_URL/smart_headers/repo.git" &&
291
+ git update-index --add --cacheinfo 160000,$(git rev-parse HEAD),sub &&
292
+ git config -f .gitmodules submodule.sub.path sub &&
293
+ git config -f .gitmodules submodule.sub.url \
294
+ "$HTTPD_URL/smart_headers/repo.git" &&
295
+ git submodule init sub &&
296
+ test_must_fail git submodule update sub &&
297
+ git -c http.extraheader="x-magic-one: abra" \
298
+ -c http.extraheader="x-magic-two: cadabra" \
299
+ submodule update sub
300
'
301
302
stop_httpd