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.
+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