getGitDir() public method

public getGitDir ( ) : string
return string
Ejemplo n.º 1
0
 /**
  * Find the relative git directory
  *
  * @return string
  */
 public function getGitDir()
 {
     $gitDir = $this->config->getGitDir();
     if (!$this->fileSystem->exists($gitDir)) {
         throw new RuntimeException('The configured GIT directory could not be found.');
     }
     return $this->getRelativePath($gitDir);
 }
Ejemplo n.º 2
0
 /**
  * @return string
  */
 protected function guessGitDir()
 {
     $defaultGitDir = $this->config->getGitDir();
     try {
         $topLevel = $this->repository->run('rev-parse', array('--show-toplevel'));
     } catch (Exception $e) {
         return $defaultGitDir;
     }
     return rtrim($this->paths()->getRelativePath($topLevel), '/');
 }