/**
  * Delete all project repositories (on project deletion).
  *
  * @param Project $project
  */
 public function deleteProjectRepositories(Project $project)
 {
     $repositories = $this->repository_factory->getAllRepositories($project);
     foreach ($repositories as $repository) {
         $repository->forceMarkAsDeleted();
         $this->git_system_event_manager->queueRepositoryDeletion($repository);
     }
 }
Ejemplo n.º 2
0
 public function itCreatesRepositoryDeletionEventForRootWhenRepositoryIsGitShell()
 {
     $repository = mock('GitRepository');
     stub($repository)->getId()->returns(54);
     stub($repository)->getProjectId()->returns(116);
     stub($repository)->getBackend()->returns(mock('GitBackend'));
     expect($this->system_event_manager)->createEvent(SystemEvent_GIT_LEGACY_REPO_DELETE::NAME, "116" . SystemEvent::PARAMETER_SEPARATOR . "54", '*', SystemEvent::OWNER_ROOT)->once();
     $this->git_system_event_manager->queueRepositoryDeletion($repository);
 }
Ejemplo n.º 3
0
 private function markAsDeleted(GitRepository $repository)
 {
     $repository->markAsDeleted();
     $this->git_system_event_manager->queueRepositoryDeletion($repository);
     $this->history_dao->groupAddHistory("git_repo_delete", $repository->getName(), $repository->getProjectId());
 }