1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-03 00:36:12 +02:00

Fix up duplicate parents removal

This removes duplicate parents properly, making gitk happy again.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Linus Torvalds 2007-07-20 23:11:19 -07:00 committed by Junio C Hamano
parent 69a9b41c15
commit e1abc69b72

View File

@ -1323,16 +1323,17 @@ static enum rewrite_result rewrite_one(struct rev_info *revs, struct commit **pp
static void remove_duplicate_parents(struct commit *commit)
{
struct commit_list *p;
struct commit_list **pp = &commit->parents;
struct commit_list **pp, *p;
/* Examine existing parents while marking ones we have seen... */
for (p = commit->parents; p; p = p->next) {
pp = &commit->parents;
while ((p = *pp) != NULL) {
struct commit *parent = p->item;
if (parent->object.flags & TMP_MARK)
if (parent->object.flags & TMP_MARK) {
*pp = p->next;
continue;
}
parent->object.flags |= TMP_MARK;
*pp = p;
pp = &p->next;
}
/* ... and clear the temporary mark */