Re: [PATCH 11/17] odb: get rid of `the_repository` when handling submodule backends
- From
Derrick Stolee <stolee@gmail.com>
- Date
- May 7, 2025, 01:25 UTC
- Message-ID
- <a715e7c7-20a7-4a2f-95e3-28d4d4bc8995@gmail.com>
- In-Reply-To
- <20250506-pks-object-store-wo-the-repository-v1-11-c05b82e7b126@pks.im>
On 5/6/25 7:09 AM, Patrick Steinhardt wrote:
> 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 backend to our own object database so that the objects can be > accessed directly.
Show 13 quoted lines
> +static int register_all_submodule_backends(struct object_database *odb)
> +{
> + int ret = odb->submodule_backend_paths.nr;
> +
> + for (size_t i = 0; i < odb->submodule_backend_paths.nr; i++)
> + odb_add_to_alternates_memory(odb,
> + odb->submodule_backend_paths.items[i].string);
> + if (ret) {
> + string_list_clear(&odb->submodule_backend_paths, 0);
> + trace2_data_intmax("submodule", odb->repo,
> + "register_all_submodule_backends/registered", ret);
> + if (git_env_bool("GIT_TEST_FATAL_REGISTER_SUBMODULE_ODB", 0))
> + BUG("register_all_submodule_backends() called");Did you plan to create a test around this test variable?
Thanks, -Stolee