@matheusbsbs / matheus-bagliano / commits / cda69f481d
Fork 0

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>

Jeff King committed Nov 18, 2007 at 02:13 UTC cda69f481db510e2a3f0ca8a0f4b54123c799416
3 files changed +10 -8
cache.h
+2
@@ -514,6 +514,8 @@ struct ref {
514 #define REF_HEADS (1u << 1)
515 #define REF_TAGS (1u << 2)
516
517 +extern struct ref *find_ref_by_name(struct ref *list, const char *name);
518 +
519 #define CONNECT_VERBOSE (1u << 0)
520 extern struct child_process *git_connect(int fd[2], const char *url, const char *prog, int flags);
521 extern int finish_connect(struct child_process *conn);
refs.c
+8
@@ -1445,3 +1445,11 @@ int update_ref(const char *action, const char *refname,
1445 }
1446 return 0;
1447 }
1448 +
1449 +struct ref *find_ref_by_name(struct ref *list, const char *name)
1450 +{
1451 + for ( ; list; list = list->next)
1452 + if (!strcmp(list->name, name))
1453 + return list;
1454 + return NULL;
1455 +}
remote.c
-8
@@ -696,14 +696,6 @@ static int match_explicit_refs(struct ref *src, struct ref *dst,
696 return -errs;
697 }
698
699 -static struct ref *find_ref_by_name(struct ref *list, const char *name)
700 -{
701 - for ( ; list; list = list->next)
702 - if (!strcmp(list->name, name))
703 - return list;
704 - return NULL;
705 -}
706 -
699 static const struct refspec *check_pattern_match(const struct refspec *rs,
700 int rs_nr,
701 const struct ref *src)