diff --git a/submodule.c b/submodule.c
index 1ba9646d3484fe2a11c1faba339c4e333186085e..b648927509cc4a1a663b981557f1529564121645 100644 (file)
--- a/submodule.c
+++ b/submodule.c
const char *argv[] = {NULL, NULL, "--not", "--all", NULL};
int argc = ARRAY_SIZE(argv) - 1;
+ /* No need to check if there are no submodules configured */
+ if (!config_name_for_path.nr)
+ return;
+
init_revisions(&rev, NULL);
argv[1] = xstrdup(sha1_to_hex(new_sha1));
setup_revisions(argc, argv, &rev, NULL);