Skip to content

Commit 3e122bc

Browse files
Merge pull request #6 from torhoehn
fix endless loop
2 parents c01f4f0 + 3dc0b1a commit 3e122bc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/ComposerPlugin.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,12 @@ private function detectGitDir(): void
233233
$this->gitDirectory = $possibleGitDir;
234234
return;
235235
}
236+
237+
// if we checked the root directory already, break to prevent endless loop
238+
if ($path === dirname($path)) {
239+
break;
240+
}
241+
236242
$path = \dirname($path);
237243
}
238244
throw new RuntimeException($this->pluginErrorMessage('git directory not found'));

0 commit comments

Comments
 (0)