* @param Repository $repository Repository where the command will be run
* @param string $command Git command to be run
* @return string Returns the command output
*/
public function run(Repository $repository, $command)
{
$descriptors = array(0 => array("pipe", "r"), 1 => array("pipe", "w"));
$process = proc_open($this->getPath() . ' ' . $command, $descriptors, $pipes, $repository->getPath());
if (is_resource($process)) {
$stdout = stream_get_contents($pipes[1]);
fclose($pipes[1]);
proc_close($process);
return $stdout;
}
}
/**
* Get the current Git binary path