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>
This commit is contained in:
Jeff King
2007-11-18 02:13:10 -05:00
committed by Junio C Hamano
parent 9f8a15c734
commit cda69f481d
3 changed files with 10 additions and 8 deletions

8
refs.c
View File

@ -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;
}