Example #1
0
 private function cloneRepository($path, Repository $repository)
 {
     $command = sprintf('git --git-dir=%s/.git config --get remote.origin.url | head -1', escapeshellarg($path));
     $remote = trim($this->executor->executeCommand($command));
     if ($repository->getUrl() !== $remote) {
         $path = escapeshellarg($path);
         $url = escapeshellarg($repository->getUrl());
         $this->executor->executeCommand(sprintf('git clone -b %s %s %s', $repository->getBranch(), $url, $path));
     }
 }
Example #2
0
 public function isVolumeGitRoot($volume)
 {
     return $this->repository->isRoot($volume);
 }