MCPcopy Index your code
hub / github.com/git/git / check_single_commit

Function check_single_commit

line-log.c:477–502  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

475}
476
477static struct commit *check_single_commit(struct rev_info *revs)
478{
479 struct object *commit = NULL;
480 int found = -1;
481 int i;
482
483 for (i = 0; i < revs->pending.nr; i++) {
484 struct object *obj = revs->pending.objects[i].item;
485 if (obj->flags & UNINTERESTING)
486 continue;
487 obj = deref_tag(revs->repo, obj, NULL, 0);
488 if (!obj || obj->type != OBJ_COMMIT)
489 die("Non commit %s?", revs->pending.objects[i].name);
490 if (commit)
491 die("More than one commit to dig from: %s and %s?",
492 revs->pending.objects[i].name,
493 revs->pending.objects[found].name);
494 commit = obj;
495 found = i;
496 }
497
498 if (!commit)
499 die("No commit specified?");
500
501 return (struct commit *) commit;
502}
503
504static void fill_blob_sha1(struct repository *r, struct commit *commit,
505 struct diff_filespec *spec)

Callers 1

line_log_initFunction · 0.85

Calls 2

deref_tagFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected