зеркало из https://github.com/microsoft/git.git
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>
This commit is contained in:
Родитель
2bf1db7862
Коммит
ae041a0f9a
2
http.c
2
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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче