MCPcopy Create free account
hub / github.com/git/git / refname_match

Function refname_match

refs.c:641–652  ·  view source on GitHub ↗

* Is it possible that the caller meant full_name with abbrev_name? * If so return a non-zero value to signal "yes"; the magnitude of * the returned value gives the precedence used for disambiguation. * * If abbrev_name cannot mean full_name, return 0. */

Source from the content-addressed store, hash-verified

639 * If abbrev_name cannot mean full_name, return 0.
640 */
641int refname_match(const char *abbrev_name, const char *full_name)
642{
643 const char **p;
644 const int abbrev_name_len = strlen(abbrev_name);
645 const int num_rules = NUM_REV_PARSE_RULES;
646
647 for (p = ref_rev_parse_rules; *p; p++)
648 if (!strcmp(full_name, mkpath(*p, abbrev_name_len, abbrev_name)))
649 return &ref_rev_parse_rules[num_rules] - p;
650
651 return 0;
652}
653
654/*
655 * Given a 'prefix' expand it by the rules in 'ref_rev_parse_rules' and add

Callers 4

count_refspec_matchFunction · 0.85
branch_merge_matchesFunction · 0.85
find_ref_by_name_abbrevFunction · 0.85
apply_casFunction · 0.85

Calls 1

mkpathFunction · 0.85

Tested by

no test coverage detected