Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into coding-standards-v3
Browse files Browse the repository at this point in the history
  • Loading branch information
danepowell committed Jul 10, 2024
2 parents 0b9c273 + b9a3d2b commit aa156a4
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 84 deletions.
82 changes: 39 additions & 43 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 26 additions & 4 deletions src/Command/Push/PushArtifactCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,17 +179,39 @@ private function cloneSourceBranch(Closure $outputCallback, string $artifactDir,

$outputCallback('out', "Initializing Git in $artifactDir");
$this->localMachineHelper->checkRequiredBinariesExist(['git']);
$process = $this->localMachineHelper->execute(['git', 'clone', '--depth=1', $vcsUrl, $artifactDir], $outputCallback, null, ($this->output->getVerbosity() > OutputInterface::VERBOSITY_NORMAL));
$process = $this->localMachineHelper->execute([
'git',
'clone',
'--depth=1',
$vcsUrl,
$artifactDir,
], $outputCallback, null, ($this->output->getVerbosity() > OutputInterface::VERBOSITY_NORMAL));
if (!$process->isSuccessful()) {
throw new AcquiaCliException('Failed to clone repository from the Cloud Platform: {message}', ['message' => $process->getErrorOutput()]);
}
$process = $this->localMachineHelper->execute(['git', 'fetch', '--depth=1', $vcsUrl, $vcsPath . ':' . $vcsPath], $outputCallback, $artifactDir, ($this->output->getVerbosity() > OutputInterface::VERBOSITY_NORMAL));
$process = $this->localMachineHelper->execute([
'git',
'fetch',
'--depth=1',
'--update-head-ok',
$vcsUrl,
$vcsPath . ':' . $vcsPath,
], $outputCallback, $artifactDir, ($this->output->getVerbosity() > OutputInterface::VERBOSITY_NORMAL));
if (!$process->isSuccessful()) {
// Remote branch does not exist. Just create it locally. This will create
// the new branch off of the current commit.
$process = $this->localMachineHelper->execute(['git', 'checkout', '-b', $vcsPath], $outputCallback, $artifactDir, ($this->output->getVerbosity() > OutputInterface::VERBOSITY_NORMAL));
$process = $this->localMachineHelper->execute([
'git',
'checkout',
'-b',
$vcsPath,
], $outputCallback, $artifactDir, ($this->output->getVerbosity() > OutputInterface::VERBOSITY_NORMAL));
} else {
$process = $this->localMachineHelper->execute(['git', 'checkout', $vcsPath], $outputCallback, $artifactDir, ($this->output->getVerbosity() > OutputInterface::VERBOSITY_NORMAL));
$process = $this->localMachineHelper->execute([
'git',
'checkout',
$vcsPath,
], $outputCallback, $artifactDir, ($this->output->getVerbosity() > OutputInterface::VERBOSITY_NORMAL));
}
if (!$process->isSuccessful()) {
throw new AcquiaCliException("Could not checkout $vcsPath branch locally: {message}", ['message' => $process->getErrorOutput() . $process->getOutput()]);
Expand Down
Loading

0 comments on commit aa156a4

Please sign in to comment.