From: Jonathan Nieder Date: Thu, 5 Dec 2019 09:28:28 +0000 (-0800) Subject: submodule: defend against submodule.update = !command in .gitmodules X-Git-Tag: v2.24.1~1^2~1^2~1^2~3^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c1547450748fcbac21675f2681506d2d80351a19;p=thirdparty%2Fgit.git submodule: defend against submodule.update = !command in .gitmodules In v2.15.4, we started to reject `submodule.update` settings in `.gitmodules`. Let's raise a BUG if it somehow still made it through from anywhere but the Git config. Signed-off-by: Jonathan Nieder Signed-off-by: Johannes Schindelin --- diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c index b93d624a85..f26bdace0b 100644 --- a/builtin/submodule--helper.c +++ b/builtin/submodule--helper.c @@ -1482,6 +1482,8 @@ static void determine_submodule_update_strategy(struct repository *r, die(_("Invalid update mode '%s' configured for submodule path '%s'"), val, path); } else if (sub->update_strategy.type != SM_UPDATE_UNSPECIFIED) { + if (sub->update_strategy.type == SM_UPDATE_COMMAND) + BUG("how did we read update = !command from .gitmodules?"); out->type = sub->update_strategy.type; out->command = sub->update_strategy.command; } else