public function initMeta($accessDriver) { require_once "VersionControl/Git.php"; $repo = ConfService::getRepository(); $this->repoBase = $repo->getOption("PATH"); if (!is_dir($this->repoBase . DIRECTORY_SEPARATOR . ".git")) { $git = new VersionControl_Git($this->repoBase); $git->initRepository(); } }
public function testInitRepository() { $dirname = $this->generateTmpDir(); $instance = new VersionControl_Git($dirname); $instance->initRepository(); $this->assertTrue(is_dir($dirname . DIRECTORY_SEPARATOR . '.git')); $this->removeDirectory($dirname); $dirname = $this->generateTmpDir(); $instance = new VersionControl_Git($dirname); $instance->initRepository(true); $this->assertTrue(is_file($dirname . DIRECTORY_SEPARATOR . 'HEAD')); $this->removeDirectory($dirname); }
/** * @param AbstractAccessDriver $accessDriver * @throws Exception */ public function initMeta($accessDriver) { parent::initMeta($accessDriver); require_once "VersionControl/Git.php"; $repo = $accessDriver->repository; $this->repoBase = $repo->getOption("PATH"); if (empty($this->repoBase)) { throw new Exception("Meta.git: cannot find PATH option in repository! Are you sure it's an FS-based workspace?"); } if (!is_dir($this->repoBase . DIRECTORY_SEPARATOR . ".git")) { $git = new VersionControl_Git($this->repoBase); $git->initRepository(); } }