X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=submodule.c;h=11de09ae97e09fa1146e0f567b7c360ad6ed4cb8;hb=36612e4daf8b5b5eaf16315aa13c66925f878cd6;hp=b8b0326c5090f545ebaf5e26146588e7009eed01;hpb=13d6ec913330ba90fb1a67ec5789e437f8ac4193;p=git.git diff --git a/submodule.c b/submodule.c index b8b0326c5..11de09ae9 100644 --- a/submodule.c +++ b/submodule.c @@ -373,6 +373,10 @@ void check_for_new_submodule_commits(unsigned char new_sha1[20]) 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); @@ -388,6 +392,7 @@ void check_for_new_submodule_commits(unsigned char new_sha1[20]) while (parent) { struct diff_options diff_opts; diff_setup(&diff_opts); + DIFF_OPT_SET(&diff_opts, RECURSIVE); diff_opts.output_format |= DIFF_FORMAT_CALLBACK; diff_opts.format_callback = submodule_collect_changed_cb; if (diff_setup_done(&diff_opts) < 0)