diff options
Diffstat (limited to 'http-walker.c')
| -rw-r--r-- | http-walker.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/http-walker.c b/http-walker.c index b8f0f98ae1..e417a7f51c 100644 --- a/http-walker.c +++ b/http-walker.c @@ -1,12 +1,14 @@ -#include "cache.h" +#define USE_THE_REPOSITORY_VARIABLE + +#include "git-compat-util.h" #include "repository.h" -#include "commit.h" +#include "hex.h" #include "walker.h" #include "http.h" #include "list.h" #include "transport.h" #include "packfile.h" -#include "object-store.h" +#include "object-store-ll.h" struct alt_base { char *base; @@ -52,8 +54,7 @@ static void fetch_alternates(struct walker *walker, const char *base); static void process_object_response(void *callback_data); -static void start_object_request(struct walker *walker, - struct object_request *obj_req) +static void start_object_request(struct object_request *obj_req) { struct active_request_slot *slot; struct http_object_request *req; @@ -110,7 +111,7 @@ static void process_object_response(void *callback_data) obj_req->repo = obj_req->repo->next; release_http_object_request(obj_req->req); - start_object_request(walker, obj_req); + start_object_request(obj_req); return; } } @@ -127,7 +128,7 @@ static void release_object_request(struct object_request *obj_req) free(obj_req); } -static int fill_active_slot(struct walker *walker) +static int fill_active_slot(void *data UNUSED) { struct object_request *obj_req; struct list_head *pos, *tmp, *head = &object_queue_head; @@ -135,10 +136,10 @@ static int fill_active_slot(struct walker *walker) list_for_each_safe(pos, tmp, head) { obj_req = list_entry(pos, struct object_request, node); if (obj_req->state == WAITING) { - if (has_object_file(&obj_req->oid)) + if (repo_has_object_file(the_repository, &obj_req->oid)) obj_req->state = COMPLETE; else { - start_object_request(walker, obj_req); + start_object_request(obj_req); return 1; } } @@ -153,7 +154,7 @@ static void prefetch(struct walker *walker, unsigned char *sha1) newreq = xmalloc(sizeof(*newreq)); newreq->walker = walker; - oidread(&newreq->oid, sha1); + oidread(&newreq->oid, sha1, the_repository->hash_algo); newreq->repo = data->alt; newreq->state = WAITING; newreq->req = NULL; @@ -486,13 +487,13 @@ static int fetch_object(struct walker *walker, unsigned char *hash) list_for_each(pos, head) { obj_req = list_entry(pos, struct object_request, node); - if (hasheq(obj_req->oid.hash, hash)) + if (hasheq(obj_req->oid.hash, hash, the_repository->hash_algo)) break; } if (!obj_req) return error("Couldn't find request for %s in the queue", hex); - if (has_object_file(&obj_req->oid)) { + if (repo_has_object_file(the_repository, &obj_req->oid)) { if (obj_req->req) abort_http_object_request(obj_req->req); abort_object_request(obj_req); @@ -613,7 +614,7 @@ struct walker *get_http_walker(const char *url) walker->cleanup = cleanup; walker->data = data; - add_fill_function(walker, (int (*)(void *)) fill_active_slot); + add_fill_function(NULL, fill_active_slot); return walker; } |
