sha1-file: modernize loose object file functions
[gitweb.git] / http-walker.c
index 7cdfb2f24c76d2f09b39ae2fa97685ecec2d1630..29b59e2fe0be45d9c1d4d439062fc54bda370f42 100644 (file)
@@ -58,7 +58,7 @@ static void start_object_request(struct walker *walker,
        struct active_request_slot *slot;
        struct http_object_request *req;
 
-       req = new_http_object_request(obj_req->repo->base, obj_req->oid.hash);
+       req = new_http_object_request(obj_req->repo->base, &obj_req->oid);
        if (req == NULL) {
                obj_req->state = ABORTED;
                return;
@@ -483,7 +483,7 @@ static int fetch_object(struct walker *walker, unsigned char *sha1)
 
        list_for_each(pos, head) {
                obj_req = list_entry(pos, struct object_request, node);
-               if (!hashcmp(obj_req->oid.hash, sha1))
+               if (hasheq(obj_req->oid.hash, sha1))
                        break;
        }
        if (obj_req == NULL)
@@ -543,11 +543,11 @@ static int fetch_object(struct walker *walker, unsigned char *sha1)
        } else if (req->zret != Z_STREAM_END) {
                walker->corrupt_object_found++;
                ret = error("File %s (%s) corrupt", hex, req->url);
-       } else if (hashcmp(obj_req->oid.hash, req->real_sha1)) {
+       } else if (!oideq(&obj_req->oid, &req->real_oid)) {
                ret = error("File %s has bad hash", hex);
        } else if (req->rename < 0) {
                struct strbuf buf = STRBUF_INIT;
-               sha1_file_name(the_repository, &buf, req->sha1);
+               loose_object_path(the_repository, &buf, &req->oid);
                ret = error("unable to write sha1 filename %s", buf.buf);
                strbuf_release(&buf);
        }