convert has_sha1_file() callers to has_object_file()

The only remaining callers of has_sha1_file() actually have an object_id
already. They can use the "object" variant, rather than dereferencing
the hash themselves.

The code changes here were completely generated by the included
coccinelle patch.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jeff King
2019-01-07 03:37:54 -05:00
committed by Junio C Hamano
parent d7a245730b
commit 98374a07c9
12 changed files with 47 additions and 16 deletions

View File

@ -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);