Skip to content

Commit aa18473

Browse files
Copilotalexr00
andauthored
Associate branch with PR metadata when branch is already checked out (#8625)
* Initial plan * initial plan Agent-Logs-Url: https://github.com/microsoft/vscode-pull-request-github/sessions/a73abfa2-1150-43fb-a262-a3a0d34a19c3 Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com> * Associate branch with PR metadata even when branch is already checked out When a user is already on the same branch as a PR and clicks "check out PR", fetchAndCheckout returns early without calling associateBranchWithPullRequest. This causes the review manager to report "No matching pull request metadata found" and the PR comments/review UI never loads. Fix: call associateBranchWithPullRequest before the early return. Agent-Logs-Url: https://github.com/microsoft/vscode-pull-request-github/sessions/a73abfa2-1150-43fb-a262-a3a0d34a19c3 Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
1 parent 81480e2 commit aa18473

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/github/pullRequestGitHelper.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ export class PullRequestGitHelper {
125125
// Make sure we aren't already on this branch
126126
if (repository.state.HEAD?.name === branch.name) {
127127
Logger.appendLine(`Tried to checkout ${localBranchName}, but branch is already checked out.`, PullRequestGitHelper.ID);
128+
await PullRequestGitHelper.associateBranchWithPullRequest(repository, pullRequest, localBranchName);
128129
return;
129130
}
130131

0 commit comments

Comments
 (0)