| 2057 | } |
| 2058 | |
| 2059 | static struct ref *get_local_ref(const char *name) |
| 2060 | { |
| 2061 | if (!name || name[0] == '\0') |
| 2062 | return NULL; |
| 2063 | |
| 2064 | if (starts_with(name, "refs/")) |
| 2065 | return alloc_ref(name); |
| 2066 | |
| 2067 | if (starts_with(name, "heads/") || |
| 2068 | starts_with(name, "tags/") || |
| 2069 | starts_with(name, "remotes/")) |
| 2070 | return alloc_ref_with_prefix("refs/", 5, name); |
| 2071 | |
| 2072 | return alloc_ref_with_prefix("refs/heads/", 11, name); |
| 2073 | } |
| 2074 | |
| 2075 | int get_fetch_map(const struct ref *remote_refs, |
| 2076 | const struct refspec_item *refspec, |
no test coverage detected