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

Function remove_marked_parents

revision.c:3482–3508  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3480}
3481
3482static int remove_marked_parents(struct rev_info *revs, struct commit *commit)
3483{
3484 struct commit_list **pp, *p;
3485 int nth_parent, removed = 0;
3486
3487 pp = &commit->parents;
3488 nth_parent = 0;
3489 while ((p = *pp) != NULL) {
3490 struct commit *parent = p->item;
3491 if (parent->object.flags & TMP_MARK) {
3492 parent->object.flags &= ~TMP_MARK;
3493 *pp = p->next;
3494 free(p);
3495 removed++;
3496 compact_treesame(revs, commit, nth_parent);
3497 continue;
3498 }
3499 pp = &p->next;
3500 nth_parent++;
3501 }
3502
3503 /* Removing parents can only increase TREESAMEness */
3504 if (removed && !(commit->object.flags & TREESAME))
3505 update_treesame(revs, commit);
3506
3507 return nth_parent;
3508}
3509
3510static struct commit_list **simplify_one(struct rev_info *revs, struct commit *commit, struct commit_list **tail)
3511{

Callers 1

simplify_oneFunction · 0.85

Calls 2

compact_treesameFunction · 0.85
update_treesameFunction · 0.85

Tested by

no test coverage detected