summaryrefslogtreecommitdiff
path: root/remote.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2019-04-13 05:54:31 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-04-15 05:00:52 (GMT)
commit1027186fdd3bb55b2149693550542e0647feb7a3 (patch)
treec836b7e8598cc47ab27f2eae85cb130051a6375e /remote.c
parent259eddde6a861cbff8186f37170f09566730f8eb (diff)
downloadgit-1027186fdd3bb55b2149693550542e0647feb7a3.zip
git-1027186fdd3bb55b2149693550542e0647feb7a3.tar.gz
git-1027186fdd3bb55b2149693550542e0647feb7a3.tar.bz2
remote.c: make singular free_ref() public
We provide a free_refs() function to free a list, but there's no easy way for a caller to free a single ref. Let's make our singular free_ref() function public. Since its name is so similar to the list-freeing free_refs(), and because both of those functions have the same signature, it might be easy to accidentally use the wrong one. Let's call the singular version the more verbose "free_one_ref()" to distinguish it. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'remote.c')
-rw-r--r--remote.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/remote.c b/remote.c
index 9cc3b07..3fe34ea 100644
--- a/remote.c
+++ b/remote.c
@@ -820,11 +820,11 @@ struct ref *copy_ref_list(const struct ref *ref)
return ret;
}
-static void free_ref(struct ref *ref)
+void free_one_ref(struct ref *ref)
{
if (!ref)
return;
- free_ref(ref->peer_ref);
+ free_one_ref(ref->peer_ref);
free(ref->remote_status);
free(ref->symref);
free(ref);
@@ -835,7 +835,7 @@ void free_refs(struct ref *ref)
struct ref *next;
while (ref) {
next = ref->next;
- free_ref(ref);
+ free_one_ref(ref);
ref = next;
}
}