grep: add --threads=<num> option and grep.threads configuration
[gitweb.git] / builtin / fetch.c
index 841880ec2c8259c5ad15e21f716f58652096a29b..ed84963a57b692ab36aecfed61606afcfaa6d2cd 100644 (file)
@@ -639,8 +639,7 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,
                                continue;
 
                        if (rm->peer_ref) {
-                               ref = xcalloc(1, sizeof(*ref) + strlen(rm->peer_ref->name) + 1);
-                               strcpy(ref->name, rm->peer_ref->name);
+                               ref = alloc_ref(rm->peer_ref->name);
                                hashcpy(ref->old_sha1, rm->peer_ref->old_sha1);
                                hashcpy(ref->new_sha1, rm->old_sha1);
                                ref->force = rm->peer_ref->force;