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>
This commit is contained in:

committed by
Junio C Hamano

parent
eed0e60f02
commit
05dfc7cac4
12
http.c
12
http.c
@ -2079,19 +2079,19 @@ int http_fetch_ref(const char *base, struct ref *ref)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Helpers for fetching packs */
|
/* Helpers for fetching packs */
|
||||||
static char *fetch_pack_index(unsigned char *sha1, const char *base_url)
|
static char *fetch_pack_index(unsigned char *hash, const char *base_url)
|
||||||
{
|
{
|
||||||
char *url, *tmp;
|
char *url, *tmp;
|
||||||
struct strbuf buf = STRBUF_INIT;
|
struct strbuf buf = STRBUF_INIT;
|
||||||
|
|
||||||
if (http_is_verbose)
|
if (http_is_verbose)
|
||||||
fprintf(stderr, "Getting index for pack %s\n", sha1_to_hex(sha1));
|
fprintf(stderr, "Getting index for pack %s\n", hash_to_hex(hash));
|
||||||
|
|
||||||
end_url_with_slash(&buf, base_url);
|
end_url_with_slash(&buf, base_url);
|
||||||
strbuf_addf(&buf, "objects/pack/pack-%s.idx", sha1_to_hex(sha1));
|
strbuf_addf(&buf, "objects/pack/pack-%s.idx", hash_to_hex(hash));
|
||||||
url = strbuf_detach(&buf, NULL);
|
url = strbuf_detach(&buf, NULL);
|
||||||
|
|
||||||
strbuf_addf(&buf, "%s.temp", sha1_pack_index_name(sha1));
|
strbuf_addf(&buf, "%s.temp", sha1_pack_index_name(hash));
|
||||||
tmp = strbuf_detach(&buf, NULL);
|
tmp = strbuf_detach(&buf, NULL);
|
||||||
|
|
||||||
if (http_get_file(url, tmp, NULL) != HTTP_OK) {
|
if (http_get_file(url, tmp, NULL) != HTTP_OK) {
|
||||||
@ -2262,7 +2262,7 @@ struct http_pack_request *new_http_pack_request(
|
|||||||
|
|
||||||
end_url_with_slash(&buf, base_url);
|
end_url_with_slash(&buf, base_url);
|
||||||
strbuf_addf(&buf, "objects/pack/pack-%s.pack",
|
strbuf_addf(&buf, "objects/pack/pack-%s.pack",
|
||||||
sha1_to_hex(target->hash));
|
hash_to_hex(target->hash));
|
||||||
preq->url = strbuf_detach(&buf, NULL);
|
preq->url = strbuf_detach(&buf, NULL);
|
||||||
|
|
||||||
strbuf_addf(&preq->tmpfile, "%s.temp", sha1_pack_name(target->hash));
|
strbuf_addf(&preq->tmpfile, "%s.temp", sha1_pack_name(target->hash));
|
||||||
@ -2289,7 +2289,7 @@ struct http_pack_request *new_http_pack_request(
|
|||||||
if (http_is_verbose)
|
if (http_is_verbose)
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Resuming fetch of pack %s at byte %"PRIuMAX"\n",
|
"Resuming fetch of pack %s at byte %"PRIuMAX"\n",
|
||||||
sha1_to_hex(target->hash),
|
hash_to_hex(target->hash),
|
||||||
(uintmax_t)prev_posn);
|
(uintmax_t)prev_posn);
|
||||||
http_opt_request_remainder(preq->slot->curl, prev_posn);
|
http_opt_request_remainder(preq->slot->curl, prev_posn);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user