diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c index 79044ae53d..98f303f5fa 100644 --- a/builtin/submodule--helper.c +++ b/builtin/submodule--helper.c @@ -127,7 +127,8 @@ static int module_name(int argc, const char **argv, const char *prefix) */ static int submodule_config_ok(const char *var) { - if (starts_with(var, "credential.")) + if (starts_with(var, "credential.") || + (starts_with(var, "http.") && ends_with(var, ".extraheader"))) return 1; return 0; } diff --git a/t/t5551-http-fetch-smart.sh b/t/t5551-http-fetch-smart.sh index e44fe72c7a..179416818d 100755 --- a/t/t5551-http-fetch-smart.sh +++ b/t/t5551-http-fetch-smart.sh @@ -286,7 +286,16 @@ test_expect_success 'custom http headers' ' test_must_fail git fetch "$HTTPD_URL/smart_headers/repo.git" && git -c http.extraheader="x-magic-one: abra" \ -c http.extraheader="x-magic-two: cadabra" \ - fetch "$HTTPD_URL/smart_headers/repo.git" + fetch "$HTTPD_URL/smart_headers/repo.git" && + git update-index --add --cacheinfo 160000,$(git rev-parse HEAD),sub && + git config -f .gitmodules submodule.sub.path sub && + git config -f .gitmodules submodule.sub.url \ + "$HTTPD_URL/smart_headers/repo.git" && + git submodule init sub && + test_must_fail git submodule update sub && + git -c http.extraheader="x-magic-one: abra" \ + -c http.extraheader="x-magic-two: cadabra" \ + submodule update sub ' stop_httpd