From 1dba604ba12bf627f61dbde30cf4df42637a682c Mon Sep 17 00:00:00 2001 From: Nami-Doc Date: Thu, 5 Apr 2012 18:46:15 +0300 Subject: [PATCH] Update src/Composer/Repository/Vcs/GitDriver.php --- src/Composer/Repository/Vcs/GitDriver.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Composer/Repository/Vcs/GitDriver.php b/src/Composer/Repository/Vcs/GitDriver.php index 4a88ecc31..645feea4e 100644 --- a/src/Composer/Repository/Vcs/GitDriver.php +++ b/src/Composer/Repository/Vcs/GitDriver.php @@ -54,11 +54,12 @@ class GitDriver extends VcsDriver $command = sprintf('git clone --mirror %s %s', escapeshellarg($this->url), escapeshellarg($this->repoDir)); if (0 !== $this->process->execute($command, $output)) { $output = $this->process->getErrorOutput(); - if (false === strpos($this->process->execute('git --version', $handler), 'git version')) { - throw new \RuntimeException('Failed to clone '.$this->url.', 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 clone '.$this->url.', could not read packages from it ('.$output.')'); + + if (127 === $this->process->execute('git --version', $handler)) { + throw new \RuntimeException('Failed to clone '.$this->url.', git isn\'t accessible through the console, please check your installation and your PATH env.' . "\n\n" . $this->process->getErrorOutput()); } + + throw new \RuntimeException('Failed to clone '.$this->url.', could not read packages from it ('.$output.')'); } } }