summaryrefslogtreecommitdiffstats
path: root/http-walker.c
diff options
context:
space:
mode:
Diffstat (limited to 'http-walker.c')
-rw-r--r--http-walker.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/http-walker.c b/http-walker.c
index fb2d86d5e7..7918ddc096 100644
--- a/http-walker.c
+++ b/http-walker.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+#define DISABLE_SIGN_COMPARE_WARNINGS
#include "git-compat-util.h"
#include "repository.h"
@@ -147,14 +148,14 @@ static int fill_active_slot(void *data UNUSED)
return 0;
}
-static void prefetch(struct walker *walker, unsigned char *sha1)
+static void prefetch(struct walker *walker, const struct object_id *oid)
{
struct object_request *newreq;
struct walker_data *data = walker->data;
newreq = xmalloc(sizeof(*newreq));
newreq->walker = walker;
- oidread(&newreq->oid, sha1, the_repository->hash_algo);
+ oidcpy(&newreq->oid, oid);
newreq->repo = data->alt;
newreq->state = WAITING;
newreq->req = NULL;
@@ -422,7 +423,8 @@ static int fetch_indices(struct walker *walker, struct alt_base *repo)
return ret;
}
-static int http_fetch_pack(struct walker *walker, struct alt_base *repo, unsigned char *sha1)
+static int http_fetch_pack(struct walker *walker, struct alt_base *repo,
+ const struct object_id *oid)
{
struct packed_git *target;
int ret;
@@ -431,7 +433,7 @@ static int http_fetch_pack(struct walker *walker, struct alt_base *repo, unsigne
if (fetch_indices(walker, repo))
return -1;
- target = find_sha1_pack(sha1, repo->packs);
+ target = find_oid_pack(oid, repo->packs);
if (!target)
return -1;
close_pack_index(target);
@@ -440,7 +442,7 @@ static int http_fetch_pack(struct walker *walker, struct alt_base *repo, unsigne
fprintf(stderr, "Getting pack %s\n",
hash_to_hex(target->hash));
fprintf(stderr, " which contains %s\n",
- hash_to_hex(sha1));
+ oid_to_hex(oid));
}
preq = new_http_pack_request(target->hash, repo->base);
@@ -477,9 +479,9 @@ static void abort_object_request(struct object_request *obj_req)
release_object_request(obj_req);
}
-static int fetch_object(struct walker *walker, unsigned char *hash)
+static int fetch_object(struct walker *walker, const struct object_id *oid)
{
- char *hex = hash_to_hex(hash);
+ char *hex = oid_to_hex(oid);
int ret = 0;
struct object_request *obj_req = NULL;
struct http_object_request *req;
@@ -487,7 +489,7 @@ 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, the_repository->hash_algo))
+ if (oideq(&obj_req->oid, oid))
break;
}
if (!obj_req)
@@ -548,20 +550,20 @@ static int fetch_object(struct walker *walker, unsigned char *hash)
return ret;
}
-static int fetch(struct walker *walker, unsigned char *hash)
+static int fetch(struct walker *walker, const struct object_id *oid)
{
struct walker_data *data = walker->data;
struct alt_base *altbase = data->alt;
- if (!fetch_object(walker, hash))
+ if (!fetch_object(walker, oid))
return 0;
while (altbase) {
- if (!http_fetch_pack(walker, altbase, hash))
+ if (!http_fetch_pack(walker, altbase, oid))
return 0;
fetch_alternates(walker, data->alt->base);
altbase = altbase->next;
}
- return error("Unable to find %s under %s", hash_to_hex(hash),
+ return error("Unable to find %s under %s", oid_to_hex(oid),
data->alt->base);
}