Merge pull request #2037 from stefankommm/fix-branch-name

Fix: Encapsulated branch name when cloning branch
This commit is contained in:
Andras Bacsai 2024-04-25 13:16:06 +02:00 committed by GitHub
commit b0e0b38549
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -579,9 +579,9 @@ function generateGitImportCommands(string $deployment_uuid, int $pull_request_id
['repository' => $customRepository, 'port' => $customPort] = $this->customRepository(); ['repository' => $customRepository, 'port' => $customPort] = $this->customRepository();
$baseDir = $custom_base_dir ?? $this->generateBaseDir($deployment_uuid); $baseDir = $custom_base_dir ?? $this->generateBaseDir($deployment_uuid);
$commands = collect([]); $commands = collect([]);
$git_clone_command = "git clone -b {$this->git_branch}"; $git_clone_command = "git clone -b \"{$this->git_branch}\"";
if ($only_checkout) { if ($only_checkout) {
$git_clone_command = "git clone --no-checkout -b {$this->git_branch}"; $git_clone_command = "git clone --no-checkout -b \"{$this->git_branch}\"";
} }
if ($pull_request_id !== 0) { if ($pull_request_id !== 0) {
$pr_branch_name = "pr-{$pull_request_id}-coolify"; $pr_branch_name = "pr-{$pull_request_id}-coolify";