Re: [PATCH 11/17] odb: get rid of `the_repository` when handling submodule backends

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux