From: Junio C Hamano Date: Wed, 5 Dec 2007 01:07:10 +0000 (-0800) Subject: Merge branch 'sp/refspec-match' X-Git-Tag: v1.5.4-rc0~79 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9bbe6db85f368fc4f75cc9f6c4bfaf2269bf0068;p=git.git Merge branch 'sp/refspec-match' * sp/refspec-match: refactor fetch's ref matching to use refname_match() push: use same rules as git-rev-parse to resolve refspecs add refname_match() push: support pushing HEAD to real branch name --- 9bbe6db85f368fc4f75cc9f6c4bfaf2269bf0068 diff --cc remote.c index 46e5f0424,48812a713..3fb0f99b2 --- a/remote.c +++ b/remote.c @@@ -818,13 -785,13 +796,13 @@@ int branch_merge_matches(struct branch { if (!branch || i < 0 || i >= branch->merge_nr) return 0; - return ref_matches_abbrev(branch->merge[i]->src, refname); + return refname_match(branch->merge[i]->src, refname, ref_fetch_rules); } -static struct ref *get_expanded_map(struct ref *remote_refs, +static struct ref *get_expanded_map(const struct ref *remote_refs, const struct refspec *refspec) { - struct ref *ref; + const struct ref *ref; struct ref *ret = NULL; struct ref **tail = &ret; @@@ -853,11 -820,11 +831,11 @@@ return ret; } -static struct ref *find_ref_by_name_abbrev(struct ref *refs, const char *name) +static const struct ref *find_ref_by_name_abbrev(const struct ref *refs, const char *name) { - struct ref *ref; + const struct ref *ref; for (ref = refs; ref; ref = ref->next) { - if (ref_matches_abbrev(name, ref->name)) + if (refname_match(name, ref->name, ref_fetch_rules)) return ref; } return NULL;