[PATCH v2 1/3] object-file: don't exit early if skipping loose
- From
- Jonathan Tan <jonathantanmy@google.com>
- Date
- Dec 7, 2022, 00:40 UTC
- Message-ID
- <9ad34a1dce977044066de0bfa6e25977215e8dc9.1670373420.git.jonathantanmy@google.com>
- In-Reply-To
- <cover.1670373420.git.jonathantanmy@google.com>
Instead, also search the submodule object stores and promisor remotes.
This also centralizes what happens when the object is not found (the "return -1"), which is useful for a subsequent patch.
Signed-off-by: Jonathan Tan <jonathantanmy@google.com> --- object-file.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/object-file.c b/object-file.c index 26290554bb..596dd049fd 100644 --- a/object-file.c +++ b/object-file.c @@ -1575,18 +1575,17 @@ static int do_oid_object_info_extended(struct repository *r, if (find_pack_entry(r, real, &e)) break; - if (flags & OBJECT_INFO_IGNORE_LOOSE) - return -1; - - /* Most likely it's a loose object. */ - if (!loose_object_info(r, real, oi, flags)) - return 0; - - /* Not a loose object; someone else may have just packed it. */ - if (!(flags & OBJECT_INFO_QUICK)) { - reprepare_packed_git(r); - if (find_pack_entry(r, real, &e)) - break; + if (!(flags & OBJECT_INFO_IGNORE_LOOSE)) { + /* Most likely it's a loose object. */ + if (!loose_object_info(r, real, oi, flags)) + return 0; + + /* Not a loose object; someone else may have just packed it. */ + if (!(flags & OBJECT_INFO_QUICK)) { + reprepare_packed_git(r); + if (find_pack_entry(r, real, &e)) + break; + } } /*
-- 2.39.0.rc0.267.gcb52ba06e7-goog