mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-21 04:50:55 +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;
|
$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;
|
||||||
|
|
Loading…
Reference in a new issue