From 4d5d5247045f2875cc6516d061641459a2108e3b Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 7 May 2015 16:27:06 +0100 Subject: [PATCH] Clear stat cache after a git failure as it might have modified the filesystem --- src/Composer/Util/Git.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Composer/Util/Git.php b/src/Composer/Util/Git.php index 9678020bc..5d84ebbf3 100644 --- a/src/Composer/Util/Git.php +++ b/src/Composer/Util/Git.php @@ -214,6 +214,9 @@ class Git private function throwException($message, $url) { + // git might delete a directory when it fails and php will not know + clearstatcache(); + if (0 !== $this->process->execute('git --version', $ignoredOutput)) { throw new \RuntimeException('Failed to clone '.self::sanitizeUrl($url).', git was not found, check that it is installed and in your PATH env.' . "\n\n" . $this->process->getErrorOutput()); }