diff --git a/submodule.c b/submodule.c
index 7a76edf911d941722586abb4f38284fc4e6909ec..ad86534ba1e1e1726fd6427c65182ba954957904 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);