]> git.ipfire.org Git - thirdparty/git.git/commitdiff
submodule: defend against submodule.update = !command in .gitmodules
authorJonathan Nieder <jrnieder@gmail.com>
Thu, 5 Dec 2019 09:28:28 +0000 (01:28 -0800)
committerJohannes Schindelin <johannes.schindelin@gmx.de>
Fri, 6 Dec 2019 15:30:50 +0000 (16:30 +0100)
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>
builtin/submodule--helper.c

index b93d624a859c2e321f92adf7676451011e662465..f26bdace0ba9c185ddf196e7e79206cc2d25e17d 100644 (file)
@@ -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