Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "pull request cannot be activated because the source and/or the target branch no longer exists" error #1366

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ export class AzureDevOpsWebApiClient {
throw new Error(`Repository '${project}/${repository}' not found`);
}

return repo.defaultBranch;
// Strip reference prefix from the branch name, the caller doesn't need to know this
return repo.defaultBranch?.replace(/^refs\/heads\//i, '');
} catch (e) {
error(`Failed to get default branch for '${project}/${repository}': ${e}`);
console.debug(e); // Dump the error stack trace to help with debugging
Expand Down