/** * 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); }
/** * @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), '/'); }