[PATCH v2 05/13] object-file-convert: implement mapping in terms of object DB
- From
Christian Couder <christian.couder@gmail.com>
- Date
- Oct 23, 2026, 07:25 UTC
- Message-ID
- <20261023072559.3204273-6-christian.couder@gmail.com>
- In-Reply-To
- <20261023072559.3204273-1-christian.couder@gmail.com>
From: "brian m. carlson" <sandals@crustytoothpaste.net>
Now that we have odb_map_oid, let's implement repo_oid_to_algop in terms of it. We still need the latter because it does some cleanup that needs to happen so that our object database backend need not deal with these issues.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Christian Couder <christian.couder@gmail.com> --- object-file-convert.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/object-file-convert.c b/object-file-convert.c index 63ee18630b..90a75a6c21 100644 --- a/object-file-convert.c +++ b/object-file-convert.c @@ -7,6 +7,7 @@ #include "repository.h" #include "hash.h" #include "object.h" +#include "odb.h" #include "loose.h" #include "commit.h" #include "gpg-interface.h" @@ -35,18 +36,7 @@ int repo_oid_to_algop(struct repository *repo, const struct object_id *srcoid, oidcpy(dest, src); return 0; } - if (repo_loose_object_map_oid(repo, src, to, dest)) { - /* - * We may have loaded the object map at repo initialization but - * another process (perhaps upstream of a pipe from us) may have - * written a new object into the map. If the object is missing, - * let's reload the map to see if the object has appeared. - */ - repo_read_loose_object_map(repo); - if (repo_loose_object_map_oid(repo, src, to, dest)) - return -1; - } - return 0; + return odb_map_oid(repo->objects, src, to, dest, 0); } static int decode_tree_entry_raw(struct object_id *oid, const char **path,
-- 2.56.0.215.g47fdf2208c