]> git.ipfire.org Git - thirdparty/git.git/blobdiff - connect.c
use alloc_ref_from_str() everywhere
[thirdparty/git.git] / connect.c
index 67d2cd86a89a92f8f75baa7ae5e820ac3150f3b4..b69060bca0917cf84612f861dbc8be5d1c6f775c 100644 (file)
--- a/connect.c
+++ b/connect.c
@@ -90,9 +90,8 @@ struct ref **get_remote_heads(int in, struct ref **list,
                        continue;
                if (nr_match && !path_match(name, nr_match, match))
                        continue;
-               ref = alloc_ref(name_len + 1);
+               ref = alloc_ref_from_str(buffer + 41);
                hashcpy(ref->old_sha1, old_sha1);
-               memcpy(ref->name, buffer + 41, name_len + 1);
                *list = ref;
                list = &ref->next;
        }