object-store: drop loose_object_path()

The function `loose_object_path()` is a trivial wrapper around
`odb_loose_path()`, with the only exception that it always uses the
primary object database of the given repository. This doesn't really add
a ton of value though, so let's drop the function and inline it at every
callsite.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Patrick Steinhardt
2025-04-29 09:52:16 +02:00
committed by Junio C Hamano
parent ddb28da58f
commit 56ef85e82f
6 changed files with 10 additions and 18 deletions

View File

@@ -9,6 +9,7 @@
#include "list.h"
#include "transport.h"
#include "packfile.h"
#include "object-file.h"
#include "object-store.h"
struct alt_base {
@@ -540,7 +541,7 @@ static int fetch_object(struct walker *walker, const struct object_id *oid)
ret = error("File %s has bad hash", hex);
} else if (req->rename < 0) {
struct strbuf buf = STRBUF_INIT;
loose_object_path(the_repository, &buf, &req->oid);
odb_loose_path(the_repository->objects->odb, &buf, &req->oid);
ret = error("unable to write sha1 filename %s", buf.buf);
strbuf_release(&buf);
}