Skip to content

Resolve conflicts through the GitHub API for GitHub Remote Repositories on desktop - #9160

Draft
Alex Ross (alexr00) with Copilot wants to merge 2 commits into
mainfrom
copilot/resolve-conflicts-issue
Draft

Alex Ross (alexr00) with Copilot wants to merge 2 commits into
mainfrom
copilot/resolve-conflicts-issue

Conversation

Copilot AI commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

With a GitHub Remote Repository (vscode-vfs) open in VS Code Desktop, Resolve Conflicts flashed a notification and did nothing. The button then stayed disabled until the view was reopened. The same pull request works on vscode.dev and in a local clone.

Cause

tryMergeBaseIntoHead chose between the GitHub API and local Git by checking the app host (vscode.dev or github.dev). On desktop, a checked-out pull request in a remote repository therefore went down the local-Git path (repository.fetch + repository.merge), which the virtual repository can't run. The resulting error was never caught, so the webview never received a reply and the button stayed busy.

Changes

  • FolderRepositoryManager.tryMergeBaseIntoHead

    • Repositories with the vscode-vfs scheme now follow the same path as the browser: the merge editor, then PullRequestModel.updateBranch through the API.
    • The "Please check out the pull request" hint in the "too many file changes" error now appears only when merging with local Git is possible.
    const canMergeWithGit = !isBrowser && this.repository.rootUri.scheme !== Schemes.VscodeVfs;
    if (!pullRequest.isActive || !canMergeWithGit) { /* GitHub API conflict resolution */ }
  • PullRequestReviewCommon.updateBranch

    • Catches errors from tryMergeBaseIntoHead, logs them and shows an error message.
    • Always replies to the webview with canUpdateBranch: true, so any failed update re-enables the button.
  • Tests (src/test/github/folderRepositoryManager.test.ts)

    • A checked-out vscode-vfs pull request with conflicts opens conflict resolution and never calls local fetch or merge.
    • A failed update shows an error and replies so the branch can be updated again.

Unchanged

  • Local file: repositories still merge with local Git.
  • vscode.dev and github.dev behave as before.
  • reviewManager.switch (the other caller, used for the merge/update-base-on-checkout settings) has its own error handling. For remote repositories it now takes the browser path too.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.