mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-30 09:20:58 +01:00
Make GitDiscovery terminate, maybe?
This commit is contained in:
parent
bb144542d3
commit
14a172d707
1 changed files with 10 additions and 0 deletions
|
@ -57,6 +57,8 @@ class PhabricatorRepositoryGitCommitDiscoveryDaemon
|
|||
$discover[] = $commit;
|
||||
$insert[] = $commit;
|
||||
|
||||
$seen_parent = array();
|
||||
|
||||
while (true) {
|
||||
$target = array_pop($discover);
|
||||
list($parents) = execx(
|
||||
|
@ -65,6 +67,14 @@ class PhabricatorRepositoryGitCommitDiscoveryDaemon
|
|||
$target);
|
||||
$parents = array_filter(explode(' ', trim($parents)));
|
||||
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)) {
|
||||
$discover[] = $parent;
|
||||
$insert[] = $parent;
|
||||
|
|
Loading…
Reference in a new issue