Inheritance: extends Symfony\Component\Console\Helper\Helper, implements Gush\Helper\OutputAwareInterface
Exemplo n.º 1
0
 /**
  * Ensures the fetching of notes is configured for the remote.
  *
  * @param string $remote
  */
 public function ensureNotesFetching($remote)
 {
     $fetches = StringUtil::splitLines($this->getGitConfig('remote.' . $remote . '.fetch', 'local', true));
     if (!in_array('+refs/notes/*:refs/notes/*', $fetches, true)) {
         $this->getHelperSet()->get('gush_style')->note(sprintf('Set fetching of notes for remote "%s".', $remote));
         $this->processHelper->runCommand(['git', 'config', '--add', '--local', 'remote.' . $remote . '.fetch', '+refs/notes/*:refs/notes/*']);
     }
 }
Exemplo n.º 2
0
 /**
  * @return string
  */
 public function getGitDir()
 {
     if (null !== $this->topDir) {
         return $this->topDir;
     }
     $this->topDir = $this->processHelper->runCommand(['git', 'rev-parse', '--show-toplevel']);
     return $this->topDir;
 }
Exemplo n.º 3
0
 public function commit($message, array $options = [])
 {
     $params = '';
     foreach ($options as $option => $value) {
         if (is_int($option)) {
             $params[] = '-' . $value;
         } else {
             $params[] = '-' . $option;
             $params[] = $value;
         }
     }
     $tmpName = $this->filesystemHelper->newTempFilename();
     file_put_contents($tmpName, $message);
     $this->processHelper->runCommand(array_merge(['git', 'commit', '-F', $tmpName], $params));
 }
Exemplo n.º 4
0
 /**
  * @test
  * @dataProvider repoUrlProvider
  */
 public function gets_information_about_the_remote($url, array $expectedInfo)
 {
     $this->processHelper->expects($this->atLeastOnce())->method('runCommand')->with($this->equalTo('git config --local --get remote.origin.url'))->will($this->returnValue($url));
     $this->assertEquals($expectedInfo, $this->gitConfigHelper->getRemoteInfo('origin'));
 }