Skip to content

Commit ae041a0

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

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

http.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2065,7 +2065,7 @@ int http_fetch_ref(const char *base, struct ref *ref)
20652065
url = quote_ref_url(base, ref->name);
20662066
if (http_get_strbuf(url, &buffer, &options) == HTTP_OK) {
20672067
strbuf_rtrim(&buffer);
2068-
if (buffer.len == 40)
2068+
if (buffer.len == the_hash_algo->hexsz)
20692069
ret = get_oid_hex(buffer.buf, &ref->old_oid);
20702070
else if (starts_with(buffer.buf, "ref: ")) {
20712071
ref->symref = xstrdup(buffer.buf + 5);

0 commit comments

Comments
 (0)