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>
* 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));
return ret;
}
+void add_submodule_odb_by_path(const char *path)
+{
+ string_list_insert(&added_submodule_odb_paths, xstrdup(path));
+}
+
int register_all_submodule_odb_as_alternates(void)
{
int i;
* the_repository.
*/
int add_submodule_odb(const char *path);
+void add_submodule_odb_by_path(const char *path);
int register_all_submodule_odb_as_alternates(void);
/*