getRepository(); if (!Filesystem::pathExists($repository->getLocalPath())) { $this->raiseCloneException(); } return; } public function getBranch() { if ($this->branch) { return $this->branch; } if ($this->repository) { return $this->repository->getDetail('default-branch', 'default'); } throw new Exception("Unable to determine branch!"); } public function getCommit() { if ($this->commit) { return $this->commit; } return $this->getBranch(); } public function getStableCommitName() { if (!$this->stableCommitName) { if ($this->commit) { $this->stableCommitName = $this->commit; } else { list($this->stableCommitName) = $this->repository->execxLocalCommand( 'log --template=%s --rev %s', '{node}', $this->getBranch()); } } return $this->stableCommitName; } }