1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-21 13:00:56 +01:00

Make GitDiscovery terminate, maybe?

This commit is contained in:
epriestley 2011-03-15 14:25:47 -07:00
parent bb144542d3
commit 14a172d707

View file

@ -57,6 +57,8 @@ class PhabricatorRepositoryGitCommitDiscoveryDaemon
$discover[] = $commit; $discover[] = $commit;
$insert[] = $commit; $insert[] = $commit;
$seen_parent = array();
while (true) { while (true) {
$target = array_pop($discover); $target = array_pop($discover);
list($parents) = execx( list($parents) = execx(
@ -65,6 +67,14 @@ class PhabricatorRepositoryGitCommitDiscoveryDaemon
$target); $target);
$parents = array_filter(explode(' ', trim($parents))); $parents = array_filter(explode(' ', trim($parents)));
foreach ($parents as $parent) { foreach ($parents as $parent) {
if (isset($seen_parent[$parent])) {
// We end up in a loop here somehow when we parse Arcanist if we
// don't do this. TODO: Figure out why and draw a pretty diagram
// since it's not evident how parsing a DAG with this causes the
// loop to stop terminating.
continue;
}
$seen_parent[$parent] = true;
if (!$this->isKnownCommit($parent)) { if (!$this->isKnownCommit($parent)) {
$discover[] = $parent; $discover[] = $parent;
$insert[] = $parent; $insert[] = $parent;