| 266 | } |
| 267 | |
| 268 | static 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 | |
| 287 | struct ambiguous_output { |
| 288 | const struct disambiguate_state *ds; |
no test coverage detected