Thread (57 messages) 57 messages, 7 authors, 2021-10-12

Re: [PATCH v3 5/7] object-file: only register submodule ODB if needed

flat view

From: Jonathan Tan <hidden>
Date: 2021-10-08 20:22:40

quoted
@@ -1614,7 +1614,8 @@ static int do_oid_object_info_extended(struct repository *r,
 				break;
 		}
 
-		if (register_all_submodule_odb_as_alternates())
+		if (r == the_repository &&
+		    register_all_submodule_odb_as_alternates())
 			/* We added some alternates; retry */
 			continue;
 
-- 
2.33.0.685.g46640cef36-goog
It looks like this is just a small bugfix, but can you expand on the
implications here? What happens if r != the_repository?
The purpose of the quoted block (before and after the check added in
this patch) is so that reading submodule objects by reading them as if
they were in the_repository works, and it follows that this is only
necessary if we pass the_repository (because we are reading them as if
they were in the_repository). I'll add a comment explaining this.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help