protected function fetchReposConfig(Project $project, GitRepository $repository) { $repo_full_name = $this->repoFullName($repository, $project->getUnixName()); $repo_config = 'repo ' . $repo_full_name . PHP_EOL; $repo_config .= $this->fetchMailHookConfig($project, $repository); $repo_config .= $this->permissions_serializer->getForRepository($repository); $description = preg_replace("%\\s+%", ' ', $repository->getDescription()); $repo_config .= "{$repo_full_name} = \"{$description}\"" . PHP_EOL; return $repo_config . PHP_EOL; }
public function __only__itGrantsReadAccessToGitoliteAdminForMirrorUsers() { stub($this->mirror_mapper)->fetchAll()->returns(array($this->mirror_1, $this->mirror_2)); $serializer = new Git_Gitolite_ConfigPermissionsSerializer($this->mirror_mapper, 'whatever'); $this->assertEqual(file_get_contents(dirname(__FILE__) . '/_fixtures/mirrors_gitolite.conf'), $serializer->getGitoliteDotConf(array('projecta', 'projectb'))); }
private function writeGitoliteMirrorIncludes($hostname, Git_Gitolite_GitModifications $git_modifications, array $project_list) { $hostname_config_file = $this->getFullConfigFilePathFromHostname($hostname); file_put_contents($hostname_config_file, $this->permissions_serializer->getAllIncludesForHostname($hostname, $project_list)); $git_modifications->add($this->getRelativeConfigFilePathFromHostname($hostname)); }