summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2020-09-22 12:36:28 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-09-22 12:36:28 -0700
commitbcb68bff80eab46f9d5f367555da803e61d3d7c8 (patch)
tree65f0ad5f0305922a7719313b9285fab4861fdc1c /builtin
parentFifteenth batch (diff)
parentfetch: do not look for submodule changes in unchanged refs (diff)
downloadtgif-bcb68bff80eab46f9d5f367555da803e61d3d7c8.tar.xz
Merge branch 'os/fetch-submodule-optim'
Optimization around submodule handling. * os/fetch-submodule-optim: fetch: do not look for submodule changes in unchanged refs
Diffstat (limited to 'builtin')
-rw-r--r--builtin/fetch.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c
index c555836937..76a4d14f57 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -966,8 +966,10 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,
ref->force = rm->peer_ref->force;
}
- if (recurse_submodules != RECURSE_SUBMODULES_OFF)
+ if (recurse_submodules != RECURSE_SUBMODULES_OFF &&
+ (!rm->peer_ref || !oideq(&ref->old_oid, &ref->new_oid))) {
check_for_new_submodule_commits(&rm->old_oid);
+ }
if (!strcmp(rm->name, "HEAD")) {
kind = "";