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>

brian m. carlson committed Feb 19, 2019 at 00:05 UTC 05dfc7cac4a0e0dcd6c7b2f63009c03f96dba1c0
1 file changed +6 -6
http.c
+6 -6
@@ -2079,19 +2079,19 @@ int http_fetch_ref(const char *base, struct ref *ref)
2079 }
2080
2081 /* 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)
2083 {
2084 char *url, *tmp;
2085 struct strbuf buf = STRBUF_INIT;
2086
2087 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));
2089
2090 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));
2092 url = strbuf_detach(&buf, NULL);
2093
2094 - strbuf_addf(&buf, "%s.temp", sha1_pack_index_name(sha1));
2094 + strbuf_addf(&buf, "%s.temp", sha1_pack_index_name(hash));
2095 tmp = strbuf_detach(&buf, NULL);
2096
2097 if (http_get_file(url, tmp, NULL) != HTTP_OK) {
@@ -2262,7 +2262,7 @@ struct http_pack_request *new_http_pack_request(
2262
2263 end_url_with_slash(&buf, base_url);
2264 strbuf_addf(&buf, "objects/pack/pack-%s.pack",
2265 - sha1_to_hex(target->hash));
2265 + hash_to_hex(target->hash));
2266 preq->url = strbuf_detach(&buf, NULL);
2267
2268 strbuf_addf(&preq->tmpfile, "%s.temp", sha1_pack_name(target->hash));
@@ -2289,7 +2289,7 @@ struct http_pack_request *new_http_pack_request(
2289 if (http_is_verbose)
2290 fprintf(stderr,
2291 "Resuming fetch of pack %s at byte %"PRIuMAX"\n",
2292 - sha1_to_hex(target->hash),
2292 + hash_to_hex(target->hash),
2293 (uintmax_t)prev_posn);
2294 http_opt_request_remainder(preq->slot->curl, prev_posn);
2295 }