Skip to content

Commit

Permalink
Update CosyComposer.php
Browse files Browse the repository at this point in the history
  • Loading branch information
eiriksm committed Aug 4, 2022
1 parent 7dbfbdd commit 7a4a886
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/CosyComposer.php
Original file line number Diff line number Diff line change
Expand Up @@ -1480,9 +1480,11 @@ protected function handleIndividualUpdates($data, $lockdata, $cdata, $one_pr_per
if (!$old_item_is_branch && !$new_item_is_branch && !$is_an_actual_upgrade) {
throw new NotUpdatedException('The new version is lower than the installed version');
}
$this->log(sprintf('Changing branch because of an unexpected update result. We expected the branch name to be %s but instead we are now switching to %s.', $branch_name, $new_branch_name));
$this->execCommand('git checkout -b ' . $new_branch_name, false);
$branch_name = $new_branch_name;
if ($branch_name !== $new_branch_name) {
$this->log(sprintf('Changing branch because of an unexpected update result. We expected the branch name to be %s but instead we are now switching to %s.', $branch_name, $new_branch_name));
$this->execCommand('git checkout -b ' . $new_branch_name, false);
$branch_name = $new_branch_name;
}
// Check if this new branch name has a pr up-to-date.
if (array_key_exists($branch_name, $prs_named)) {
if (!$default_base) {
Expand Down

0 comments on commit 7a4a886

Please sign in to comment.