Skip to content

Commit 05dfc7c

Browse files
bk2204gitster
authored andcommitted
http: replace sha1_to_hex
Since sha1_to_hex is limited to SHA-1, replace it with hash_to_hex. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent eed0e60 commit 05dfc7c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

http.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2079,19 +2079,19 @@ int http_fetch_ref(const char *base, struct ref *ref)
20792079
}
20802080

20812081
/* Helpers for fetching packs */
2082-
static char *fetch_pack_index(unsigned char *sha1, const char *base_url)
2082+
static char *fetch_pack_index(unsigned char *hash, const char *base_url)
20832083
{
20842084
char *url, *tmp;
20852085
struct strbuf buf = STRBUF_INIT;
20862086

20872087
if (http_is_verbose)
2088-
fprintf(stderr, "Getting index for pack %s\n", sha1_to_hex(sha1));
2088+
fprintf(stderr, "Getting index for pack %s\n", hash_to_hex(hash));
20892089

20902090
end_url_with_slash(&buf, base_url);
2091-
strbuf_addf(&buf, "objects/pack/pack-%s.idx", sha1_to_hex(sha1));
2091+
strbuf_addf(&buf, "objects/pack/pack-%s.idx", hash_to_hex(hash));
20922092
url = strbuf_detach(&buf, NULL);
20932093

2094-
strbuf_addf(&buf, "%s.temp", sha1_pack_index_name(sha1));
2094+
strbuf_addf(&buf, "%s.temp", sha1_pack_index_name(hash));
20952095
tmp = strbuf_detach(&buf, NULL);
20962096

20972097
if (http_get_file(url, tmp, NULL) != HTTP_OK) {
@@ -2262,7 +2262,7 @@ struct http_pack_request *new_http_pack_request(
22622262

22632263
end_url_with_slash(&buf, base_url);
22642264
strbuf_addf(&buf, "objects/pack/pack-%s.pack",
2265-
sha1_to_hex(target->hash));
2265+
hash_to_hex(target->hash));
22662266
preq->url = strbuf_detach(&buf, NULL);
22672267

22682268
strbuf_addf(&preq->tmpfile, "%s.temp", sha1_pack_name(target->hash));
@@ -2289,7 +2289,7 @@ struct http_pack_request *new_http_pack_request(
22892289
if (http_is_verbose)
22902290
fprintf(stderr,
22912291
"Resuming fetch of pack %s at byte %"PRIuMAX"\n",
2292-
sha1_to_hex(target->hash),
2292+
hash_to_hex(target->hash),
22932293
(uintmax_t)prev_posn);
22942294
http_opt_request_remainder(preq->slot->curl, prev_posn);
22952295
}

0 commit comments

Comments
 (0)