Re: [PATCH 02/16] refs: add methods for misc ref operations
On Fri, 2015-12-11 at 15:33 -0800, Junio C Hamano wrote:
Show 24 quoted lines
> David Turner <dturner@twopensource.com> writes:
>
> > diff --git a/cache.h b/cache.h
> > index 51c35c3..707455a 100644
> > --- a/cache.h
> > +++ b/cache.h
> > @@ -1111,6 +1111,13 @@ extern char *oid_to_hex(const struct object_id *oid); /* same static buffer as s
> > extern int interpret_branch_name(const char *str, int len, struct strbuf *);
> > extern int get_sha1_mb(const char *str, unsigned char *sha1);
> >
> > +/*
> > + * Return true iff abbrev_name is a possible abbreviation for
> > + * full_name according to the rules defined by ref_rev_parse_rules in
> > + * refs.c.
> > + */
> > +extern int refname_match(const char *abbrev_name, const char *full_name);
> > +
> > extern int validate_headref(const char *ref);
>
> This hunk is strange. It duplicates what is in refs.h, risking the
> two copies to drift away from each other over time.
>
> As the only callsites are in remote.c that includes refs.h, this
> probably should be dropped.