Merge branch 'jl/maint-fetch-submodule-check-fix' into maint
authorJunio C Hamano <gitster@pobox.com>
Mon, 12 Sep 2011 17:19:57 +0000 (10:19 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 12 Sep 2011 17:19:57 +0000 (10:19 -0700)
* jl/maint-fetch-submodule-check-fix:
fetch: skip on-demand checking when no submodules are configured

1  2 
submodule.c
diff --combined submodule.c
index 1ba9646d3484fe2a11c1faba339c4e333186085e,e0d5dcfedd2b9b7381ea5f26fbe779994e2fc3f9..b648927509cc4a1a663b981557f1529564121645
@@@ -373,6 -373,10 +373,10 @@@ void check_for_new_submodule_commits(un
        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);
                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)