/** * @param GitCommand $gitCommand * @return string */ protected function run(GitCommand $gitCommand) { $gitProcess = new GitProcess($this, $gitCommand); $gitProcess->run(); if (!empty($gitProcess->getExitCode())) { throw new \RuntimeException('Git command "' . $gitCommand->getCommandLine() . '" in "' . $gitCommand->getDirectory() . '" failed with error "' . $gitProcess->getErrorOutput() . '"', 1456365593); } $output = $gitProcess->getOutput(); if (empty($output)) { $output = $gitProcess->getErrorOutput(); } return $output; }