| 989 | } |
| 990 | |
| 991 | struct ref *copy_ref(const struct ref *ref) |
| 992 | { |
| 993 | struct ref *cpy; |
| 994 | size_t len; |
| 995 | if (!ref) |
| 996 | return NULL; |
| 997 | len = st_add3(sizeof(struct ref), strlen(ref->name), 1); |
| 998 | cpy = xmalloc(len); |
| 999 | memcpy(cpy, ref, len); |
| 1000 | cpy->next = NULL; |
| 1001 | cpy->symref = xstrdup_or_null(ref->symref); |
| 1002 | cpy->remote_status = xstrdup_or_null(ref->remote_status); |
| 1003 | cpy->peer_ref = copy_ref(ref->peer_ref); |
| 1004 | return cpy; |
| 1005 | } |
| 1006 | |
| 1007 | struct ref *copy_ref_list(const struct ref *ref) |
| 1008 | { |
no test coverage detected