Exemple #1
0
 /**
  * @param Git $git
  */
 public function __construct(Git $git)
 {
     parent::__construct($git);
     $this->head = new Remote\SetHeadCommand($git);
     $this->branches = new Remote\SetBranchesCommand($git);
     $this->url = new Remote\SetUrlCommand($git);
 }
 /**
  * Run any git command, like "status" or "checkout -b mybranch origin/mybranch"
  *
  * @throws  RuntimeException
  * @param   string  $commandString
  * @return  string  $output
  */
 public function cmd($commandString)
 {
     // clean commands that begin with "git "
     $commandString = preg_replace('/^git\\s/', '', $commandString);
     $commandString = $this->options['git_executable'] . ' ' . $commandString;
     $command = new Command($this->dir, $commandString, $this->debug);
     return $command->run();
 }