瀏覽代碼

Avoid clearing the error output during removeDirectory execution, losing git error output, fixes #8351

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

+ 3 - 1
src/Composer/Util/Git.php

@@ -215,10 +215,12 @@ class Git
                 }
             }
 
+            $errorMsg = $this->process->getErrorOutput();
             if ($initialClone) {
                 $this->filesystem->removeDirectory($origCwd);
             }
-            $this->throwException('Failed to execute ' . $command . "\n\n" . $this->process->getErrorOutput(), $url);
+
+            $this->throwException('Failed to execute ' . $command . "\n\n" . $errorMsg, $url);
         }
     }