Skip to content

Resolve insteadOf URL aliases in remaining remote-parsing call sites#8754

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-configuring-remotes-issue
Draft

Resolve insteadOf URL aliases in remaining remote-parsing call sites#8754
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-configuring-remotes-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 19, 2026

With a global git config like url.https://github.abc.com/.insteadOf=github:, git clone github:org/repo leaves github:org/repo as the literal remote URL. The extension would fail to recognize the host and get stuck configuring remotes.

resolveGitUrl + parseRepositoryRemotesAsync (which apply url.<base>.insteadOf substitutions before parsing) already existed, but only two call sites in FolderRepositoryManager had been migrated. Several other paths still used the sync parseRepositoryRemotes and silently dropped aliased remotes.

Changes

  • folderRepositoryManager.tscreateGitHubRepositoryFromOwnerName now awaits parseRepositoryRemotesAsync; dropped the now-unused sync import.
  • stateManager.tssetIssueData uses the async variant for enterprise-remote detection (affects which auth provider is selected for issue queries).
  • pullRequestGitHelper.tscreateRemote and getUniqueRemoteName (promoted to async, sole caller already awaited) use the async variant, so PR-checkout's dedup and unique-name logic sees aliased remotes.
  • src/test/common/remote.test.ts — new unit tests covering basic insteadOf substitution, longest-prefix selection on overlapping aliases, and the no-match passthrough.

Intentionally not migrated

ReviewManager state-change comparison and PostCommitCommandsProvider.getCommands remain on the sync variant — both are synchronous VS Code API surfaces and neither is on the failing setup path; switching them would require larger refactors for no user-visible benefit here.

Note

This is an extension-side mitigation for the underlying upstream gap tracked at microsoft/vscode#174941; if the git extension begins surfacing the resolved URL directly, the resolveGitUrl helper can be retired.

Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix extension stuck on configuring remotes with global 'url aliasing' Resolve insteadOf URL aliases in remaining remote-parsing call sites May 19, 2026
Copilot AI requested a review from alexr00 May 19, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extension stuck on configuring remotes with global "url aliasing"

2 participants