diff options
| author | Patrick Steinhardt <ps@pks.im> | 2025-07-01 14:22:23 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-07-01 14:46:37 -0700 |
| commit | fc28a8a856a1e7978794e7dee61c42d7d5740a6b (patch) | |
| tree | d86bf61bdd4f201cb86998393087359b24fb5035 /submodule.h | |
| parent | odb: get rid of `the_repository` when handling the primary source (diff) | |
| download | git-fc28a8a856a1e7978794e7dee61c42d7d5740a6b.tar.gz git-fc28a8a856a1e7978794e7dee61c42d7d5740a6b.zip | |
odb: get rid of `the_repository` when handling submodule sources
The "--recursive" flag for git-grep(1) allows users to grep for a string
across submodule boundaries. To make this work we add each submodule's
object sources to our own object database so that the objects can be
accessed directly.
The infrastructure for this depends on a global string list of submodule
paths. The caller is expected to call `add_submodule_odb_by_path()` for
each source and the object database will then eventually register all
submodule sources via `do_oid_object_info_extended()` in case it isn't
able to look up a specific object.
This reliance on global state is of course suboptimal with regards to
our libification efforts.
Refactor the logic so that the list of submodule sources is instead
tracked in the object database itself. This allows us to lose the
condition of `r == the_repository` before registering submodule sources
as we only ever add submodule sources to `the_repository` anyway. As
such, behaviour before and after this refactoring should always be the
same.
Rename the functions accordingly.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'submodule.h')
| -rw-r--r-- | submodule.h | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/submodule.h b/submodule.h index db980c1d08..b10e16e6c0 100644 --- a/submodule.h +++ b/submodule.h @@ -105,15 +105,6 @@ int submodule_uses_gitfile(const char *path); int bad_to_remove_submodule(const char *path, unsigned flags); /* - * Call add_submodule_odb_by_path() to add the submodule at the given - * path to a list. When register_all_submodule_odb_as_alternates() is - * called, the object stores of all submodules in that list will be - * added as alternates in the_repository. - */ -void add_submodule_odb_by_path(const char *path); -int register_all_submodule_odb_as_alternates(void); - -/* * Checks if there are submodule changes in a..b. If a is the null OID, * checks b and all its ancestors instead. */ |
