protected function getRepository()
 {
     $repository = new Repository($this, $this->repositoryOwner, $this->repositoryName, $this->vcsType);
     $repository->setRemoteName($this->remoteName);
     $repository->setReadUrl($this->repositoryReadUrl);
     $repository->setWriteUrl($this->repositoryWriteUrl);
     $repository->setWebUrl($this->repositoryWebUrl);
     $repository->setRef($this->repositoryRef);
     $repository->setRealRef($this->repositoryRealRef);
     $repository->setRefType($this->repositoryRefType);
     $repository->setReadonly($this->repositoryReadonly);
     return $repository;
 }
 protected function buildRepository($repositoryData, $ref, $realRef, $refType)
 {
     $repository = new Repository($this, $repositoryData['owner'], $repositoryData['slug'], $repositoryData['scm']);
     $repository->setRemoteName($this->remoteName);
     $repository->setReadUrl(sprintf('https://bitbucket.org/%s/%s.git', $repositoryData['owner'], $repositoryData['slug']));
     $repository->setWriteUrl(sprintf('git@bitbucket.org:%s/%s.git', $repositoryData['owner'], $repositoryData['slug']));
     $repository->setWebUrl(sprintf('https://bitbucket.org/%s/%s', $repositoryData['owner'], $repositoryData['slug']));
     $repository->setRef($ref);
     $repository->setRealRef($realRef);
     $repository->setRefType($refType);
     $repository->setReadonly($repositoryData['read_only']);
     return $repository;
 }
 protected function buildRepository($repositoryData, $ref, $realRef, $refType)
 {
     $repository = new Repository($this, $repositoryData['owner']['login'], $repositoryData['name'], 'git');
     $repository->setRemoteName($this->remoteName);
     $repository->setReadUrl(sprintf('https://github.com/%s.git', $repositoryData['full_name']));
     $repository->setWriteUrl(sprintf('git@github.com:%s.git', $repositoryData['full_name']));
     $repository->setWebUrl(sprintf('https://github.com/%s', $repositoryData['full_name']));
     $repository->setRef($ref);
     $repository->setRealRef($realRef);
     $repository->setRefType($refType);
     $repository->setReadonly(isset($repositoryData['permissions']['push']) ? !$repositoryData['permissions']['push'] : true);
     return $repository;
 }