aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/pull.c
diff options
context:
space:
mode:
authorDerrick Stolee <dstolee@microsoft.com>2021-12-22 14:20:52 +0000
committerJunio C Hamano <gitster@pobox.com>2021-12-22 11:42:39 -0800
commit5a4e0547e2386f9bf0565316d7b751fe9459898b (patch)
tree0b5919a74ceffe48ceaaadf6c0f4a7100559a519 /builtin/pull.c
parent597af311a2899bfd6640b9b107622c5795d5f998 (diff)
downloadgit-5a4e0547e2386f9bf0565316d7b751fe9459898b.tar.gz
fetch/pull: use the sparse index
The 'git fetch' and 'git pull' commands parse the index in order to determine if submodules exist. Without command_requires_full_index=0, this will expand a sparse index, causing slow performance even when there is no new data to fetch. The .gitmodules file will never be inside a sparse directory entry, and even if it was, the index_name_pos() method would expand the sparse index if needed as we search for the path by name. These commands do not iterate over the index, which is the typical thing we are careful about when integrating with the sparse index. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/pull.c')
-rw-r--r--builtin/pull.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/pull.c b/builtin/pull.c
index c8457619d8..100cbf9fb8 100644
--- a/builtin/pull.c
+++ b/builtin/pull.c
@@ -994,6 +994,8 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
set_reflog_message(argc, argv);
git_config(git_pull_config, NULL);
+ prepare_repo_settings(the_repository);
+ the_repository->settings.command_requires_full_index = 0;
argc = parse_options(argc, argv, prefix, pull_options, pull_usage, 0);