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

[PATCH 6/9] object-file: only register submodule ODB if needed

flat view
STALE1839d SUPERSEDED

From: Jonathan Tan <hidden>
Date: 2021-09-21 16:51:32
Subsystem: the rest · Maintainer: Linus Torvalds

Status: Superseded by v4 (posted 2021-10-08). [go to v4]

Revision v1 (4 revisions archived).

Revisions (4)
  1. v1 current
  2. v2 [diff against previous]
  3. v3 [diff against previous]
  4. v4 [diff against previous]
In a35e03dee0 ("submodule: lazily add submodule ODBs as alternates",
2021-09-08), Git was taught to add all known submodule ODBs as
alternates when attempting to read an object that doesn't exist, as a
fallback for when a submodule object is read as if it were in
the_repository. However, this behavior wasn't restricted to happen only
when reading from the_repository. Fix this.

Signed-off-by: Jonathan Tan <redacted>
---
 object-file.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/object-file.c b/object-file.c
index 621b121bcb..ab861dfdeb 100644
--- a/object-file.c
+++ b/object-file.c
@@ -1593,7 +1593,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.464.g1972c5931b-goog
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help