* 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. */
| 639 | * If abbrev_name cannot mean full_name, return 0. |
| 640 | */ |
| 641 | int 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 |
no test coverage detected