Skip to content

Commit

Permalink
Merge pull request #6 from torhoehn
Browse files Browse the repository at this point in the history
fix endless loop
  • Loading branch information
sebastianfeldmann committed May 8, 2020
2 parents c01f4f0 + 3dc0b1a commit 3e122bc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/ComposerPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,12 @@ private function detectGitDir(): void
$this->gitDirectory = $possibleGitDir;
return;
}

// if we checked the root directory already, break to prevent endless loop
if ($path === dirname($path)) {
break;
}

$path = \dirname($path);
}
throw new RuntimeException($this->pluginErrorMessage('git directory not found'));
Expand Down

0 comments on commit 3e122bc

Please sign in to comment.