diff options
author | Jonathan Tan <jonathantanmy@google.com> | 2021-08-17 00:09:52 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-09-08 21:47:49 +0300 |
commit | 8d33c3af0b2113091ea2c2c94990d0332c9551e7 (patch) | |
tree | 5bffcf5ca31a4cdedb6bb0c562d4ed16600ed24e /builtin/grep.c | |
parent | a35e03dee0e8daa442227018ecd180ae1c1b39bc (diff) |
grep: use submodule-ODB-as-alternate lazy-addition
In the parent commit, Git was taught to add submodule ODBs as alternates
lazily, but grep does not use this because it computes the path to add
directly, not going through add_submodule_odb(). Add an equivalent to
add_submodule_odb() that takes the exact ODB path and teach grep to use
it.
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Reviewed-by: Emily Shaffer <emilyshaffer@google.com>
Reviewed-by: Matheus Tavares <matheus.bernardino@usp.br>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/grep.c')
-rw-r--r-- | builtin/grep.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/grep.c b/builtin/grep.c index 7d2f8e5adb..87bcb934a2 100644 --- a/builtin/grep.c +++ b/builtin/grep.c @@ -450,7 +450,7 @@ static int grep_submodule(struct grep_opt *opt, * store is no longer global and instead is a member of the repository * object. */ - add_to_alternates_memory(subrepo.objects->odb->path); + add_submodule_odb_by_path(subrepo.objects->odb->path); obj_read_unlock(); memcpy(&subopt, opt, sizeof(subopt)); |