alloc_ref_from_str(): factor out a common pattern of alloc_ref from string
Also fix an underallocation in walker.c::interpret_target(). Signed-off-by: Krzysztof Kowalczyk <kkowalczyk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
1f8115b113
commit
737922aa64
@ -508,10 +508,8 @@ static void find_non_local_tags(struct transport *transport,
|
||||
will_fetch(head, ref->old_sha1))) {
|
||||
path_list_insert(ref_name, &new_refs);
|
||||
|
||||
rm = alloc_ref(strlen(ref_name) + 1);
|
||||
strcpy(rm->name, ref_name);
|
||||
rm->peer_ref = alloc_ref(strlen(ref_name) + 1);
|
||||
strcpy(rm->peer_ref->name, ref_name);
|
||||
rm = alloc_ref_from_str(ref_name);
|
||||
rm->peer_ref = alloc_ref_from_str(ref_name);
|
||||
hashcpy(rm->old_sha1, ref_sha1);
|
||||
|
||||
**tail = rm;
|
||||
|
||||
Reference in New Issue
Block a user