@matheusbsbs / matheus-bagliano / commits / c154745074
Fork 0

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 <jrnieder@gmail.com> Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>

Jonathan Nieder committed Dec 5, 2019 at 01:28 UTC c1547450748fcbac21675f2681506d2d80351a19
1 file changed +2
builtin/submodule--helper.c
+2
@@ -1482,6 +1482,8 @@ static void determine_submodule_update_strategy(struct repository *r,
1482 die(_("Invalid update mode '%s' configured for submodule path '%s'"),
1483 val, path);
1484 } else if (sub->update_strategy.type != SM_UPDATE_UNSPECIFIED) {
1485 + if (sub->update_strategy.type == SM_UPDATE_COMMAND)
1486 + BUG("how did we read update = !command from .gitmodules?");
1487 out->type = sub->update_strategy.type;
1488 out->command = sub->update_strategy.command;
1489 } else