Skip to content

Commit f25a2a5

Browse files
derrickstoleedscho
authored andcommitted
fetch/pull: use the sparse index
The 'git fetch' and 'git pull' commands somehow read the index. In the case of 'git pull', much of the reason is that the HEAD might change due to the update from the remote. It is unclear why 'git fetch' needs it. However, I was able to measure time in ensure_full_index() because these commands do parse an index. Signed-off-by: Derrick Stolee <[email protected]>
1 parent 8675e5f commit f25a2a5

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

builtin/fetch.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2002,6 +2002,8 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
20022002
}
20032003

20042004
git_config(git_fetch_config, NULL);
2005+
prepare_repo_settings(the_repository);
2006+
the_repository->settings.command_requires_full_index = 0;
20052007

20062008
argc = parse_options(argc, argv, prefix,
20072009
builtin_fetch_options, builtin_fetch_usage, 0);

builtin/pull.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -994,6 +994,8 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
994994
set_reflog_message(argc, argv);
995995

996996
git_config(git_pull_config, NULL);
997+
prepare_repo_settings(the_repository);
998+
the_repository->settings.command_requires_full_index = 0;
997999

9981000
argc = parse_options(argc, argv, prefix, pull_options, pull_usage, 0);
9991001

0 commit comments

Comments
 (0)