Skip to content

Commit 2bf1db7

Browse files
bk2204gitster
authored andcommitted
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>
1 parent 1cb158b commit 2bf1db7

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

http-walker.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -434,9 +434,9 @@ static int http_fetch_pack(struct walker *walker, struct alt_base *repo, unsigne
434434

435435
if (walker->get_verbosely) {
436436
fprintf(stderr, "Getting pack %s\n",
437-
sha1_to_hex(target->hash));
437+
hash_to_hex(target->hash));
438438
fprintf(stderr, " which contains %s\n",
439-
sha1_to_hex(sha1));
439+
hash_to_hex(sha1));
440440
}
441441

442442
preq = new_http_pack_request(target, repo->base);
@@ -473,17 +473,17 @@ static void abort_object_request(struct object_request *obj_req)
473473
release_object_request(obj_req);
474474
}
475475

476-
static int fetch_object(struct walker *walker, unsigned char *sha1)
476+
static int fetch_object(struct walker *walker, unsigned char *hash)
477477
{
478-
char *hex = sha1_to_hex(sha1);
478+
char *hex = hash_to_hex(hash);
479479
int ret = 0;
480480
struct object_request *obj_req = NULL;
481481
struct http_object_request *req;
482482
struct list_head *pos, *head = &object_queue_head;
483483

484484
list_for_each(pos, head) {
485485
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))
487487
break;
488488
}
489489
if (obj_req == NULL)
@@ -557,20 +557,20 @@ static int fetch_object(struct walker *walker, unsigned char *sha1)
557557
return ret;
558558
}
559559

560-
static int fetch(struct walker *walker, unsigned char *sha1)
560+
static int fetch(struct walker *walker, unsigned char *hash)
561561
{
562562
struct walker_data *data = walker->data;
563563
struct alt_base *altbase = data->alt;
564564

565-
if (!fetch_object(walker, sha1))
565+
if (!fetch_object(walker, hash))
566566
return 0;
567567
while (altbase) {
568-
if (!http_fetch_pack(walker, altbase, sha1))
568+
if (!http_fetch_pack(walker, altbase, hash))
569569
return 0;
570570
fetch_alternates(walker, data->alt->base);
571571
altbase = altbase->next;
572572
}
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),
574574
data->alt->base);
575575
}
576576

0 commit comments

Comments
 (0)