From: Ronnie Sahlberg <sahlberg@xxxxxxxxxx> These functions do not depend on the backend implementation so we move them to the common code. Signed-off-by: Ronnie Sahlberg <sahlberg@xxxxxxxxxx> Signed-off-by: David Turner <dturner@xxxxxxxxxxx> --- refs-be-files.c | 18 ------------------ refs.c | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/refs-be-files.c b/refs-be-files.c index 9c0dd5c..f67ff41 100644 --- a/refs-be-files.c +++ b/refs-be-files.c @@ -1800,24 +1800,6 @@ struct ref_filter { void *cb_data; }; -int read_ref_full(const char *refname, int resolve_flags, unsigned char *sha1, int *flags) -{ - if (resolve_ref_unsafe(refname, resolve_flags, sha1, flags)) - return 0; - return -1; -} - -int read_ref(const char *refname, unsigned char *sha1) -{ - return read_ref_full(refname, RESOLVE_REF_READING, sha1, NULL); -} - -int ref_exists(const char *refname) -{ - unsigned char sha1[20]; - return !!resolve_ref_unsafe(refname, RESOLVE_REF_READING, sha1, NULL); -} - static int filter_refs(const char *refname, const struct object_id *oid, int flags, void *data) { diff --git a/refs.c b/refs.c index 24d5e28..242f66d 100644 --- a/refs.c +++ b/refs.c @@ -633,3 +633,21 @@ void warn_dangling_symrefs(FILE *fp, const char *msg_fmt, const struct string_li data.msg_fmt = msg_fmt; for_each_rawref(warn_if_dangling_symref, &data); } + +int read_ref_full(const char *refname, int resolve_flags, unsigned char *sha1, int *flags) +{ + if (resolve_ref_unsafe(refname, resolve_flags, sha1, flags)) + return 0; + return -1; +} + +int read_ref(const char *refname, unsigned char *sha1) +{ + return read_ref_full(refname, RESOLVE_REF_READING, sha1, NULL); +} + +int ref_exists(const char *refname) +{ + unsigned char sha1[20]; + return !!resolve_ref_unsafe(refname, RESOLVE_REF_READING, sha1, NULL); +} -- 2.0.4.315.gad8727a-twtrsrc -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html