isVersioned() public méthode

True if the working directory is versioned
public isVersioned ( ) : boolean
Résultat boolean
Exemple #1
0
 private function createGitRepository()
 {
     if (!$this->repository->isVersioned()) {
         $this->reportProgressChange(InitializerStates::CREATING_GIT_REPOSITORY);
         $this->repository->init();
         $this->installGitignore();
     }
 }
 private function createGitRepository()
 {
     if (!$this->repository->isVersioned()) {
         $this->reportProgressChange(InitializerStates::CREATING_GIT_REPOSITORY);
         $this->repository->init();
     }
     $this->installGitignore();
     MergeDriverInstaller::installMergeDriver(VP_PROJECT_ROOT, VERSIONPRESS_PLUGIN_DIR, VP_VPDB_DIR);
 }
 /**
  * Create CommitAsserter to start tracking the git repo for future asserts. Should generally
  * be called after a test setup (if there is any) and before all the actual work. Asserts follow
  * after it.
  *
  * @param \VersionPress\Git\GitRepository $gitRepository
  * @param DbSchemaInfo $dbSchema
  * @param ActionsInfoProvider $actionsInfoProvider
  * @param string[] $pathPlaceholders
  */
 public function __construct($gitRepository, DbSchemaInfo $dbSchema, ActionsInfoProvider $actionsInfoProvider, $pathPlaceholders = [])
 {
     $this->gitRepository = $gitRepository;
     $this->pathPlaceholders = $pathPlaceholders;
     $this->dbSchema = $dbSchema;
     $this->actionsInfoProvider = $actionsInfoProvider;
     if ($gitRepository->isVersioned()) {
         $this->startCommit = $gitRepository->getCommit($gitRepository->getLastCommitHash());
     }
 }