Add allocation and freeing functions for struct refs
Instead of open-coding allocation wherever it happens, have a function. Also, add a function to free a list of refs, which we currently never actually do. Signed-off-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
54dadbdb29
commit
dfd255dd1a
7
remote.h
7
remote.h
@ -30,6 +30,13 @@ struct refspec {
|
||||
char *dst;
|
||||
};
|
||||
|
||||
struct ref *alloc_ref(unsigned namelen);
|
||||
|
||||
/*
|
||||
* Frees the entire list and peers of elements.
|
||||
*/
|
||||
void free_refs(struct ref *ref);
|
||||
|
||||
int match_refs(struct ref *src, struct ref *dst, struct ref ***dst_tail,
|
||||
int nr_refspec, char **refspec, int all);
|
||||
|
||||
|
Reference in New Issue
Block a user