http-walker: replace sha1_to_hex

Since sha1_to_hex is limited to SHA-1, replace the uses of it in this file with hash_to_hex. Rename several variables accordingly to reflect that they are no longer limited to SHA-1. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

brian m. carlson committed Feb 19, 2019 at 00:05 UTC 2bf1db786273e22070227a09d346c49026659f1e
1 file changed +9 -9
http-walker.c
+9 -9
@@ -434,9 +434,9 @@ static int http_fetch_pack(struct walker *walker, struct alt_base *repo, unsigne
434
435 if (walker->get_verbosely) {
436 fprintf(stderr, "Getting pack %s\n",
437 - sha1_to_hex(target->hash));
437 + hash_to_hex(target->hash));
438 fprintf(stderr, " which contains %s\n",
439 - sha1_to_hex(sha1));
439 + hash_to_hex(sha1));
440 }
441
442 preq = new_http_pack_request(target, repo->base);
@@ -473,9 +473,9 @@ static void abort_object_request(struct object_request *obj_req)
473 release_object_request(obj_req);
474 }
475
476 -static int fetch_object(struct walker *walker, unsigned char *sha1)
476 +static int fetch_object(struct walker *walker, unsigned char *hash)
477 {
478 - char *hex = sha1_to_hex(sha1);
478 + char *hex = hash_to_hex(hash);
479 int ret = 0;
480 struct object_request *obj_req = NULL;
481 struct http_object_request *req;
@@ -483,7 +483,7 @@ static int fetch_object(struct walker *walker, unsigned char *sha1)
483
484 list_for_each(pos, head) {
485 obj_req = list_entry(pos, struct object_request, node);
486 - if (hasheq(obj_req->oid.hash, sha1))
486 + if (hasheq(obj_req->oid.hash, hash))
487 break;
488 }
489 if (obj_req == NULL)
@@ -557,20 +557,20 @@ static int fetch_object(struct walker *walker, unsigned char *sha1)
557 return ret;
558 }
559
560 -static int fetch(struct walker *walker, unsigned char *sha1)
560 +static int fetch(struct walker *walker, unsigned char *hash)
561 {
562 struct walker_data *data = walker->data;
563 struct alt_base *altbase = data->alt;
564
565 - if (!fetch_object(walker, sha1))
565 + if (!fetch_object(walker, hash))
566 return 0;
567 while (altbase) {
568 - if (!http_fetch_pack(walker, altbase, sha1))
568 + if (!http_fetch_pack(walker, altbase, hash))
569 return 0;
570 fetch_alternates(walker, data->alt->base);
571 altbase = altbase->next;
572 }
573 - return error("Unable to find %s under %s", sha1_to_hex(sha1),
573 + return error("Unable to find %s under %s", hash_to_hex(hash),
574 data->alt->base);
575 }
576