summaryrefslogtreecommitdiff
path: root/submodule.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-09-12 10:19:57 -0700
committerJunio C Hamano <gitster@pobox.com>2011-09-12 10:19:57 -0700
commit8702fee6171abb2e353499fa0cecba90ad5f277f (patch)
tree64366b7892e0fa5aac9c9526f77f532535c7f548 /submodule.c
parentc2d53586ddfdde1ff625fe58299dc81db5e6f408 (diff)
parent18322badc2b3b7f49f79da5273e003e9c0c4f549 (diff)
downloadgit-8702fee6171abb2e353499fa0cecba90ad5f277f.tar.gz
Merge branch 'jl/maint-fetch-submodule-check-fix' into maint
* jl/maint-fetch-submodule-check-fix: fetch: skip on-demand checking when no submodules are configured
Diffstat (limited to 'submodule.c')
-rw-r--r--submodule.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/submodule.c b/submodule.c
index 1ba9646d34..b648927509 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);