summaryrefslogtreecommitdiffstats
path: root/http.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2019-02-19 01:05:13 +0100
committerJunio C Hamano <gitster@pobox.com>2019-04-01 04:57:38 +0200
commitae041a0f9a8f5bd236441a9384a0119cd5a8f791 (patch)
treef0b6dba39d84c627df810eaf6e086fec719e75d8 /http.c
parenthttp-walker: replace sha1_to_hex (diff)
downloadgit-ae041a0f9a8f5bd236441a9384a0119cd5a8f791.tar.xz
git-ae041a0f9a8f5bd236441a9384a0119cd5a8f791.zip
http: replace hard-coded constant with the_hash_algo
Replace a hard-coded 40 with a reference to the_hash_algo. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'http.c')
-rw-r--r--http.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/http.c b/http.c
index a09adc518f..993ddc956a 100644
--- a/http.c
+++ b/http.c
@@ -2065,7 +2065,7 @@ int http_fetch_ref(const char *base, struct ref *ref)
url = quote_ref_url(base, ref->name);
if (http_get_strbuf(url, &buffer, &options) == HTTP_OK) {
strbuf_rtrim(&buffer);
- if (buffer.len == 40)
+ if (buffer.len == the_hash_algo->hexsz)
ret = get_oid_hex(buffer.buf, &ref->old_oid);
else if (starts_with(buffer.buf, "ref: ")) {
ref->symref = xstrdup(buffer.buf + 5);