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

Function init_object_disambiguation

object-name.c:268–285  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

266}
267
268static int init_object_disambiguation(struct repository *r,
269 const char *name, int len,
270 const struct git_hash_algo *algo,
271 struct disambiguate_state *ds)
272{
273 if (len < MINIMUM_ABBREV || len > GIT_MAX_HEXSZ)
274 return -1;
275
276 memset(ds, 0, sizeof(*ds));
277
278 if (parse_oid_prefix(name, len, algo, ds->hex_pfx, &ds->bin_pfx) < 0)
279 return -1;
280
281 ds->len = len;
282 ds->repo = r;
283 odb_prepare_alternates(r->objects);
284 return 0;
285}
286
287struct ambiguous_output {
288 const struct disambiguate_state *ds;

Callers 1

get_short_oidFunction · 0.85

Calls 2

parse_oid_prefixFunction · 0.85
odb_prepare_alternatesFunction · 0.85

Tested by

no test coverage detected