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

Function find_single_final

blame.c:2663–2686  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2661}
2662
2663static struct commit *find_single_final(struct rev_info *revs,
2664 const char **name_p)
2665{
2666 int i;
2667 struct commit *found = NULL;
2668 const char *name = NULL;
2669
2670 for (i = 0; i < revs->pending.nr; i++) {
2671 struct object *obj = revs->pending.objects[i].item;
2672 if (obj->flags & UNINTERESTING)
2673 continue;
2674 obj = deref_tag(revs->repo, obj, NULL, 0);
2675 if (!obj || obj->type != OBJ_COMMIT)
2676 die("Non commit %s?", revs->pending.objects[i].name);
2677 if (found)
2678 die("More than one commit to dig from %s and %s?",
2679 revs->pending.objects[i].name, name);
2680 found = (struct commit *)obj;
2681 name = revs->pending.objects[i].name;
2682 }
2683 if (name_p)
2684 *name_p = xstrdup_or_null(name);
2685 return found;
2686}
2687
2688static struct commit *dwim_reverse_initial(struct rev_info *revs,
2689 const char **name_p)

Callers 1

setup_scoreboardFunction · 0.85

Calls 3

deref_tagFunction · 0.85
xstrdup_or_nullFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected