Inheritance: extends Symfony\Component\Console\Helper\Helper, implements Gush\Helper\OutputAwareInterface
Ejemplo 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/*']);
     }
 }
Ejemplo 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;
 }
Ejemplo 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));
 }
Ejemplo 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'));
 }