summaryrefslogtreecommitdiff
path: root/builtin/grep.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/grep.c')
-rw-r--r--builtin/grep.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/builtin/grep.c b/builtin/grep.c
index 53cccf2d25..5b8b87b1ac 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -1213,8 +1213,14 @@ int cmd_grep(int argc,
*/
if (recurse_submodules)
repo_read_gitmodules(the_repository, 1);
- if (startup_info->have_repository)
- packfile_store_prepare(the_repository->objects->packfiles);
+
+ if (startup_info->have_repository) {
+ struct odb_source *source;
+
+ odb_prepare_alternates(the_repository->objects);
+ for (source = the_repository->objects->sources; source; source = source->next)
+ packfile_store_prepare(source->packfiles);
+ }
start_threads(&opt);
} else {