Don't recurse into parents marked uninteresting.

revision.c:make_parents_uninteresting() is exponential with the number
of merges in the tree. That's fine -- unless some other part of git
already has pulled the whole commit tree into memory ...

Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Matthias Urlichs 2006-03-09 05:04:36 +01:00 коммит произвёл Junio C Hamano
Родитель c13c6bf758
Коммит d2c4af7373
1 изменённых файлов: 13 добавлений и 11 удалений

Просмотреть файл

@ -82,18 +82,20 @@ void mark_parents_uninteresting(struct commit *commit)
while (parents) { while (parents) {
struct commit *commit = parents->item; struct commit *commit = parents->item;
commit->object.flags |= UNINTERESTING; if (!(commit->object.flags & UNINTERESTING)) {
commit->object.flags |= UNINTERESTING;
/* /*
* Normally we haven't parsed the parent * Normally we haven't parsed the parent
* yet, so we won't have a parent of a parent * yet, so we won't have a parent of a parent
* here. However, it may turn out that we've * here. However, it may turn out that we've
* reached this commit some other way (where it * reached this commit some other way (where it
* wasn't uninteresting), in which case we need * wasn't uninteresting), in which case we need
* to mark its parents recursively too.. * to mark its parents recursively too..
*/ */
if (commit->parents) if (commit->parents)
mark_parents_uninteresting(commit); mark_parents_uninteresting(commit);
}
/* /*
* A missing commit is ok iff its parent is marked * A missing commit is ok iff its parent is marked