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

Function match_explicit_lhs

remote.c:1163–1186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1161}
1162
1163static 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
1188static void show_push_unqualified_ref_name_error(const char *dst_value,
1189 const char *matched_src_name)

Callers 2

match_explicitFunction · 0.85
check_push_refsFunction · 0.85

Calls 3

count_refspec_matchFunction · 0.85
try_explicit_object_nameFunction · 0.85
errorFunction · 0.85

Tested by

no test coverage detected