From e3af4ee606023079d8af222da82a5b6f36ca879f Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 24 Feb 2021 15:46:54 +0100 Subject: [PATCH] Include stdout as well as stderr if git stash/diff/.. fails, fixes #9720 --- src/Composer/Downloader/GitDownloader.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Composer/Downloader/GitDownloader.php b/src/Composer/Downloader/GitDownloader.php index b5bd73db6..54b67983e 100644 --- a/src/Composer/Downloader/GitDownloader.php +++ b/src/Composer/Downloader/GitDownloader.php @@ -519,7 +519,7 @@ class GitDownloader extends VcsDownloader implements DvcsDownloaderInterface { $path = $this->normalizePath($path); if (0 !== $this->process->execute('git clean -df && git reset --hard', $output, $path)) { - throw new \RuntimeException("Could not reset changes\n\n:".$this->process->getErrorOutput()); + throw new \RuntimeException("Could not reset changes\n\n:".$output); } $this->hasDiscardedChanges[$path] = true; @@ -533,7 +533,7 @@ class GitDownloader extends VcsDownloader implements DvcsDownloaderInterface { $path = $this->normalizePath($path); if (0 !== $this->process->execute('git stash --include-untracked', $output, $path)) { - throw new \RuntimeException("Could not stash changes\n\n:".$this->process->getErrorOutput()); + throw new \RuntimeException("Could not stash changes\n\n:".$output); } $this->hasStashedChanges[$path] = true; @@ -547,7 +547,7 @@ class GitDownloader extends VcsDownloader implements DvcsDownloaderInterface { $path = $this->normalizePath($path); if (0 !== $this->process->execute('git diff HEAD', $output, $path)) { - throw new \RuntimeException("Could not view diff\n\n:".$this->process->getErrorOutput()); + throw new \RuntimeException("Could not view diff\n\n:".$output); } $this->io->writeError($output);