瀏覽代碼

Clear stat cache after a git failure as it might have modified the filesystem

Jordi Boggiano 9 年之前
父節點
當前提交
4d5d524704
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/Composer/Util/Git.php

+ 3 - 0
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());
         }