aboutsummaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2007-11-18 02:13:10 -0500
committerJunio C Hamano <gitster@pobox.com>2007-11-18 02:34:34 -0800
commitcda69f481db510e2a3f0ca8a0f4b54123c799416 (patch)
tree38cb123ef8297aef85b11759e1dbb074ac124347 /refs.c
parent9f8a15c73437abc634f2c43501105b108c51eae8 (diff)
downloadgit-cda69f481db510e2a3f0ca8a0f4b54123c799416.tar.gz
git-cda69f481db510e2a3f0ca8a0f4b54123c799416.tar.xz
make "find_ref_by_name" a public function
This was a static in remote.c, but is generally useful. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/refs.c b/refs.c
index aff02cd09..387c588c7 100644
--- a/refs.c
+++ b/refs.c
@@ -1445,3 +1445,11 @@ int update_ref(const char *action, const char *refname,
}
return 0;
}
+
+struct ref *find_ref_by_name(struct ref *list, const char *name)
+{
+ for ( ; list; list = list->next)
+ if (!strcmp(list->name, name))
+ return list;
+ return NULL;
+}