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

Function find_single_initial

blame.c:2726–2759  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2724}
2725
2726static struct commit *find_single_initial(struct rev_info *revs,
2727 const char **name_p)
2728{
2729 int i;
2730 struct commit *found = NULL;
2731 const char *name = NULL;
2732
2733 /*
2734 * There must be one and only one negative commit, and it must be
2735 * the boundary.
2736 */
2737 for (i = 0; i < revs->pending.nr; i++) {
2738 struct object *obj = revs->pending.objects[i].item;
2739 if (!(obj->flags & UNINTERESTING))
2740 continue;
2741 obj = deref_tag(revs->repo, obj, NULL, 0);
2742 if (!obj || obj->type != OBJ_COMMIT)
2743 die("Non commit %s?", revs->pending.objects[i].name);
2744 if (found)
2745 die("More than one commit to dig up from, %s and %s?",
2746 revs->pending.objects[i].name, name);
2747 found = (struct commit *) obj;
2748 name = revs->pending.objects[i].name;
2749 }
2750
2751 if (!name)
2752 found = dwim_reverse_initial(revs, &name);
2753 if (!name)
2754 die("No commit to dig up from?");
2755
2756 if (name_p)
2757 *name_p = xstrdup(name);
2758 return found;
2759}
2760
2761void init_scoreboard(struct blame_scoreboard *sb)
2762{

Callers 1

setup_scoreboardFunction · 0.85

Calls 4

deref_tagFunction · 0.85
dwim_reverse_initialFunction · 0.85
xstrdupFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected