`Branch changed to ${mr.source_branch}, but it's out of sync with the remote branch. Synchronize it by pushing or pulling.`,
);
return;
}
constrepo=repos[0];
showInformationMessage('Fetching branches...');
// merge from local branch
branchNameForCheckout=sourceBranchName;
awaitrepo.fetch();
awaitrepo.checkout(sourceBranchName);
assert(
repo.state.HEAD,
"We can't read repository HEAD. We suspect that your `git head` command fails and we can't continue till it succeeds",
);
constcurrentBranchName=repo.state.HEAD.name;
if(currentBranchName!==branchNameForCheckout){
thrownewError(
`The branch name after the checkout (${currentBranchName}) is not the branch that the extension tried to check out (${branchNameForCheckout}). This is an unexpected error, please inspect your repository before making any further changes.`,
);
}
sidebar.refresh();
showInformationMessage(`Branch successfully changed to ${sourceBranchName}`);
awaitvscode.window.showInformationMessage(`Branch changed to ${mr.source_branch}`);
`The branch name after the checkout (${currentBranchName}) is not the branch that the extension tried to check out (${branchName}). Inspect your repository before making any more changes.`,