This was a static in remote.c, but is generally useful.
Signed-off-by: Jeff King <peff@peff.net>
---
cache.h | 2 ++
refs.c | 8 ++++++++
remote.c | 8 --------
3 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/cache.h b/cache.h
index ba9178f..1f3f113 100644
--- a/cache.h
+++ b/cache.h
@@ -521,6 +521,8 @@ struct ref {
#define REF_HEADS (1u << 1)
#define REF_TAGS (1u << 2)
+extern struct ref *find_ref_by_name(struct ref *list, const char *name);
+
#define CONNECT_VERBOSE (1u << 0)
extern struct child_process *git_connect(int fd[2], const char *url, const char *prog, int flags);
extern int finish_connect(struct child_process *conn);
diff --git a/refs.c b/refs.c
index ae53254..54ec98d 100644
--- a/refs.c
+++ b/refs.c
@@ -1433,3 +1433,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;
+}
diff --git a/remote.c b/remote.c
index 09b7aad..bb01059 100644
--- a/remote.c
+++ b/remote.c
@@ -696,14 +696,6 @@ static int match_explicit_refs(struct ref *src, struct ref *dst,
return -errs;
}
-static 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;
-}
-
static const struct refspec *check_pattern_match(const struct refspec *rs,
int rs_nr,
const struct ref *src)
--
1.5.3.5.1817.g37c1a-dirty
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
| Borislav Petkov | 2.6.23-rc1: no setup signature found... |
| Andrew Morton | Re: [PATCH] Memory management livelock |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
| Steven King | ti_usb_3410_5052 breakage in 2.6.24-rc1 |
git: | |
| Linus Torvalds | cleaner/better zlib sources? |
| Theodore Ts'o | [PATCH] Add --no-reuse-delta, --window, and --depth options to git-gc |
| Karl | Re: [PATCH] Add a birdview-on-the-source-code section to the user manual |
| Yossi Leybovich | corrupt object on git-gc |
| GVG GVG | ssh_exchange_identification: Connection closed by remote host |
| Richard Stallman | Re: Real men don't attack straw men |
| David Newman | setting dscp or tos bits |
| Stijn | Re: [i386/Thinkpad T41]USB mouse + Xorg obsd 4.1 |
| Quentin Garnier | [cube@cubidou.net: Re: Moving ethfoo in the main tree] |
| cube | Moving ethfoo in the main tree |
| Blair Sadewitz | PCI latency timer values |
| Oliver Gould | kqemu: driver(9)/filedesc(9) questions |
