Git - respect config includes when discovering remotes - #334493
Git - respect config includes when discovering remotes#334493Iulian Dragos (dragos) wants to merge 1 commit into
Conversation
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: Ladislau Szomoru (@lszomoru)Matched files:
|
There was a problem hiding this comment.
🟡 Changes recommended
Valid commented include headers remain undetected, and Git fallback can truncate remote URLs containing spaces.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Updates Git remote discovery to respect repository-local Git config includes.
Changes:
- Detects
includeandincludeIfsections. - Falls back to Git-based remote discovery and adds detection tests.
File summaries
| File | Description |
|---|---|
extensions/git/src/git.ts |
Detects includes and selects Git-based discovery. |
extensions/git/src/test/git.test.ts |
Tests include-section detection. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| return GitConfigParser.parse(raw).some(section => { | ||
| const sectionName = section.name.toLowerCase(); | ||
| return sectionName === 'include' || sectionName === 'includeif'; | ||
| }); |
| if (hasGitConfigIncludes(raw)) { | ||
| return this.getRemotesGit(); |
|
Iulian Dragos (@dragos) please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
Fixes microsoft/vscode-pull-request-github#8928
If the local git config includes another file, fallback to git-based remote discovery instead of the custom parser. This preserves the fast path for simple config files, and fixes the issue for the others.