Skip to content

Commit

Permalink
carve out an exception in the cloneupstream singlecommit step for com…
Browse files Browse the repository at this point in the history
…mit-based updates
  • Loading branch information
jazzsequence committed Jan 26, 2024
1 parent af6fbf4 commit 75cd642
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Update/Methods/SingleCommit.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,19 @@ protected function downloadUpstream(array $parameters)
protected function cloneUpstream(array $parameters)
{
$latestTag = $parameters['latest-tag'];
$commitUpdate = $parameters['meta']['commit-update'];

// Clone the upstream. Check out just $latest
$upstream_working_copy = WorkingCopy::shallowClone($this->upstream_url, $this->upstream_dir, $latestTag, 1, $this->api);
$upstream_working_copy
->setLogger($this->logger);

// If we're making a commit-based update, we don't need to check the version.
if ($commitUpdate) {
$commitHash = $parameters['meta']['latest-commit'];
$this->logger->notice('Commit-based update found. Skipping version check and proceeding with commit {commit}', ['commit' => $commitHash]);
return $upstream_working_copy;
}
// Confirm that the local working copy of the upstream has checked out $latest
$version_info = new VersionTool();
$info = $version_info->info($upstream_working_copy->dir());
Expand Down

0 comments on commit 75cd642

Please sign in to comment.