aboutsummaryrefslogtreecommitdiff
path: root/http-walker.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-05-12 14:22:48 -0700
committerJunio C Hamano <gitster@pobox.com>2025-05-12 14:22:49 -0700
commitbd99d6e8db5e2c56dd24395e9711ee7ee564bf4f (patch)
treeb80e6131d230f068d29be426103f2b7fd87150b1 /http-walker.c
parent38758be7fa8269a5223ea6c356939e36492f81b1 (diff)
parent8a9e27be8213ab90ac761d56ac36229ee52c443f (diff)
downloadgit-bd99d6e8db5e2c56dd24395e9711ee7ee564bf4f.tar.xz
Merge branch 'ps/object-store-cleanup'
Further code clean-up in the object-store layer. * ps/object-store-cleanup: object-store: drop `repo_has_object_file()` treewide: convert users of `repo_has_object_file()` to `has_object()` object-store: allow fetching objects via `has_object()` object-store: move function declarations to their respective subsystems object-store: move and rename `odb_pack_keep()` object-store: drop `loose_object_path()` object-store: move `struct packed_git` into "packfile.h"
Diffstat (limited to 'http-walker.c')
-rw-r--r--http-walker.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/http-walker.c b/http-walker.c
index 882cae19c2..463f7b119a 100644
--- a/http-walker.c
+++ b/http-walker.c
@@ -9,6 +9,7 @@
#include "list.h"
#include "transport.h"
#include "packfile.h"
+#include "object-file.h"
#include "object-store.h"
struct alt_base {
@@ -137,7 +138,8 @@ static int fill_active_slot(void *data UNUSED)
list_for_each_safe(pos, tmp, head) {
obj_req = list_entry(pos, struct object_request, node);
if (obj_req->state == WAITING) {
- if (repo_has_object_file(the_repository, &obj_req->oid))
+ if (has_object(the_repository, &obj_req->oid,
+ HAS_OBJECT_RECHECK_PACKED | HAS_OBJECT_FETCH_PROMISOR))
obj_req->state = COMPLETE;
else {
start_object_request(obj_req);
@@ -495,7 +497,8 @@ static int fetch_object(struct walker *walker, const struct object_id *oid)
if (!obj_req)
return error("Couldn't find request for %s in the queue", hex);
- if (repo_has_object_file(the_repository, &obj_req->oid)) {
+ if (has_object(the_repository, &obj_req->oid,
+ HAS_OBJECT_RECHECK_PACKED | HAS_OBJECT_FETCH_PROMISOR)) {
if (obj_req->req)
abort_http_object_request(&obj_req->req);
abort_object_request(obj_req);
@@ -540,7 +543,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);
}