| 1161 | } |
| 1162 | |
| 1163 | static int match_explicit_lhs(struct ref *src, |
| 1164 | struct refspec_item *rs, |
| 1165 | struct ref **match, |
| 1166 | int *allocated_match) |
| 1167 | { |
| 1168 | switch (count_refspec_match(rs->src, src, match)) { |
| 1169 | case 1: |
| 1170 | if (allocated_match) |
| 1171 | *allocated_match = 0; |
| 1172 | return 0; |
| 1173 | case 0: |
| 1174 | /* The source could be in the get_sha1() format |
| 1175 | * not a reference name. :refs/other is a |
| 1176 | * way to delete 'other' ref at the remote end. |
| 1177 | */ |
| 1178 | if (try_explicit_object_name(rs->src, match) < 0) |
| 1179 | return error(_("src refspec %s does not match any"), rs->src); |
| 1180 | if (allocated_match) |
| 1181 | *allocated_match = 1; |
| 1182 | return 0; |
| 1183 | default: |
| 1184 | return error(_("src refspec %s matches more than one"), rs->src); |
| 1185 | } |
| 1186 | } |
| 1187 | |
| 1188 | static void show_push_unqualified_ref_name_error(const char *dst_value, |
| 1189 | const char *matched_src_name) |
no test coverage detected