From 66cd1aad8a5100ead1138c20249451a251d3ec8a Mon Sep 17 00:00:00 2001 From: Nami-Doc Date: Thu, 5 Apr 2012 18:30:50 +0300 Subject: [PATCH] Update src/Composer/Downloader/GitDownloader.php --- src/Composer/Downloader/GitDownloader.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Composer/Downloader/GitDownloader.php b/src/Composer/Downloader/GitDownloader.php index 169fffaa8..09e0e87a8 100644 --- a/src/Composer/Downloader/GitDownloader.php +++ b/src/Composer/Downloader/GitDownloader.php @@ -96,11 +96,10 @@ class GitDownloader extends VcsDownloader // failed to checkout, first check git accessibility $output = $this->process->getErrorOutput(); - if (false === strpos($this->process->execute('git --version', $handler), 'git version')) { - throw new \RuntimeException('It looks like git isn\'t accessible through the console, please check your installation and your PATH env.' . "\n\n" . $this->process->getErrorOutput()); - } else { - throw new \RuntimeException('Failed to checkout ' . $url .' via git, https and http protocols, aborting.' . "\n\n" . $output); - } + if (127 === $this->process->execute('git --version', $handler)) { + throw new \RuntimeException('Failed to checkout ' . $url . ' via git, it isn\'t accessible through the console, please check your installation and your PATH env.' . "\n\n" . $this->process->getErrorOutput()); + + throw new \RuntimeException('Failed to checkout ' . $url .' via git, https and http protocols, aborting.' . "\n\n" . $output); } $command = call_user_func($commandCallable, $url);