summaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2014-01-14 03:16:07 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-01-14 21:58:06 (GMT)
commit54457fe509ee311abc2c4c2a796d16ea379aa8f2 (patch)
tree9466e0bdfa871ccb7d9102daeb6d8c502fccb8c3 /refs.c
parent4224916ae979204f13db2996d9e32490e0acb90f (diff)
downloadgit-54457fe509ee311abc2c4c2a796d16ea379aa8f2.zip
git-54457fe509ee311abc2c4c2a796d16ea379aa8f2.tar.gz
git-54457fe509ee311abc2c4c2a796d16ea379aa8f2.tar.bz2
refname_match(): always use the rules in ref_rev_parse_rules
We used to use two separate rules for the normal ref resolution dwimming and dwimming done to decide which remote ref to grab. The third parameter to refname_match() selected which rules to use. When these two rules were harmonized in 2011-11-04 dd621df9cd refs DWIMmery: use the same rule for both "git fetch" and others , ref_fetch_rules was #defined to avoid potential breakages for in-flight topics. It is now safe to remove the backwards-compatibility code, so remove refname_match()'s third parameter, make ref_rev_parse_rules private to refs.c, and remove ref_fetch_rules entirely. Suggested-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/refs.c b/refs.c
index 5e5a382..5a10c25 100644
--- a/refs.c
+++ b/refs.c
@@ -1880,7 +1880,7 @@ const char *prettify_refname(const char *name)
0);
}
-const char *ref_rev_parse_rules[] = {
+static const char *ref_rev_parse_rules[] = {
"%.*s",
"refs/%.*s",
"refs/tags/%.*s",
@@ -1890,12 +1890,12 @@ const char *ref_rev_parse_rules[] = {
NULL
};
-int refname_match(const char *abbrev_name, const char *full_name, const char **rules)
+int refname_match(const char *abbrev_name, const char *full_name)
{
const char **p;
const int abbrev_name_len = strlen(abbrev_name);
- for (p = rules; *p; p++) {
+ for (p = ref_rev_parse_rules; *p; p++) {
if (!strcmp(full_name, mkpath(*p, abbrev_name_len, abbrev_name))) {
return 1;
}