diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-02-06 22:05:27 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-02-06 22:05:27 -0800 |
commit | cba595ab1a7764aecfde2e8e59994f89b2cd2f2e (patch) | |
tree | 832b23d5963d8931796fc3b9951e3708d1a40207 /http-walker.c | |
parent | Merge branch 'pw/rebase-x-sanity-check' (diff) | |
parent | prefer "hash mismatch" to "sha1 mismatch" (diff) | |
download | tgif-cba595ab1a7764aecfde2e8e59994f89b2cd2f2e.tar.xz |
Merge branch 'jk/loose-object-cache-oid'
Code clean-up.
* jk/loose-object-cache-oid:
prefer "hash mismatch" to "sha1 mismatch"
sha1-file: avoid "sha1 file" for generic use in messages
sha1-file: prefer "loose object file" to "sha1 file" in messages
sha1-file: drop has_sha1_file()
convert has_sha1_file() callers to has_object_file()
sha1-file: convert pass-through functions to object_id
sha1-file: modernize loose header/stream functions
sha1-file: modernize loose object file functions
http: use struct object_id instead of bare sha1
update comment references to sha1_object_info()
sha1-file: fix outdated sha1 comment references
Diffstat (limited to 'http-walker.c')
-rw-r--r-- | http-walker.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/http-walker.c b/http-walker.c index 0a392c85b6..8ae5d76c6a 100644 --- a/http-walker.c +++ b/http-walker.c @@ -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; @@ -131,7 +131,7 @@ 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_sha1_file(obj_req->oid.hash)) + if (has_object_file(&obj_req->oid)) obj_req->state = COMPLETE; else { start_object_request(walker, obj_req); @@ -489,7 +489,7 @@ static int fetch_object(struct walker *walker, unsigned char *sha1) if (obj_req == NULL) return error("Couldn't find request for %s in the queue", hex); - if (has_sha1_file(obj_req->oid.hash)) { + if (has_object_file(&obj_req->oid)) { if (obj_req->req != NULL) abort_http_object_request(obj_req->req); abort_object_request(obj_req); @@ -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 (!hasheq(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; - loose_object_path(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); } |