Git API omits remotes defined through repository-local include.path
Mantenedores costumam responder em até 1 dia
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 78/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- git, github, typescript
- Domínio
- api, developer-experience, tooling
Direção de pesquisa
Comece em extensions/git/src/git.ts, comparando getRemotesFS() com getRemotesGit() e verificando como a análise de configuração lida com as seções include e includeIf. Reproduza a configuração local do repositório fornecida e, em seguida, verifique se Repository.state.remotes inclui origin e se o comportamento existente de detecção de remotes do GitHub funciona corretamente.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Type: Bug
Does this issue occur when all extensions are disabled?: Yes
When remotes are defined via an include inside .git/config, they are not correctly parsed. The most visible error is via the GitHub Pull Requests extension that shows [error] [FolderRepositoryManager+0] The remote 'origin' is not a GitHub repository. even though it really is.
Steps to Reproduce:
-
Create a repository whose remote is defined in an included config:
root="$(mktemp -d)" git init "$root/repo" git config --file "$root/remotes.conf" \ remote.origin.url https://github.com/microsoft/vscode.git git config --file "$root/remotes.conf" \ remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*' git -C "$root/repo" config --local include.path "$root/remotes.conf" git -C "$root/repo" remote -v -
Confirm that Git reports
origin:origin https://github.com/microsoft/vscode.git (fetch) origin https://github.com/microsoft/vscode.git (push) -
Open
$root/repoin VS Code. -
Inspect the built-in Git extension’s
Repository.state.remotes.
Actual behavior:
Repository.state.remotes does not contain origin. Features consuming the Git API consequently behave as if the repository has no matching remote, even though Git resolves it correctly.
Expected behavior:
Repository.state.remotes should reflect Git’s effective configuration, including remotes supplied through [include] and applicable [includeIf] sections.
Root cause:
extensions/git/src/git.ts implements getRemotesFS() by reading and parsing .git/config directly:
private async getRemotesFS(): Promise<MutableRemote[]> {
const raw = await fs.readFile(
path.join(this.dotGit.commonPath ?? this.dotGit.path, 'config'),
'utf8'
);
return parseGitRemotes(raw);
}
This bypasses Git’s include processing. The existing getRemotesGit() fallback is only used when direct parsing throws, not when parsing succeeds but returns an incomplete set of remotes.
Suggested fix:
When the local config contains an include or includeIf section, use getRemotesGit() so Git resolves the effective configuration. This preserves the fast direct-file path for repositories without includes.
Extension version: 0.132.2
VS Code version: Code 1.136.1 (Universal) (a44adf7f53e00964ab890f9f8758a334f1fc15bc, 2026-09-03T05:06:41Z)
OS version: Darwin arm64 25.6.0
Modes:
Remote OS version: Linux x64 5.4.0-1161-aws-fips
System Info
| Item | Value |
|---|---|
| CPUs | Apple M4 Max (16 x 2400) |
| GPU Status | 2d_canvas: enabled GPU0: VENDOR= 0x106b [Google Inc. (Apple)], DEVICE=0x0000 [ANGLE (Apple, ANGLE Metal Renderer: Apple M4 Max, Version 26.6.2 (Build 25G83))], DRIVER_VENDOR=Apple, DRIVER_VERSION=26.6.2 ACTIVE Machine model name: Mac Machine model version: 16.5 direct_rendering_display_compositor: disabled_off_ok gpu_compositing: enabled multiple_raster_threads: enabled_on opengl: enabled_on rasterization: enabled raw_draw: disabled_off_ok skia_graphite: enabled_on trees_in_viz: disabled_off video_decode: enabled video_encode: enabled webgl: enabled webgpu: enabled webnn: disabled_off |
| Load (avg) | 3, 3, 3 |
| Memory (System) | 64.00GB (0.45GB free) |
| Process Argv | --crash-reporter-id d815658b-4870-4f52-91e0-a84e1b9dc813 |
| Screen Reader | no |
| VM | 0% |
| Item | Value |
|---|---|
| Remote | SSH: arca.ssh |
| OS | Linux x64 5.4.0-1161-aws-fips |
| CPUs | Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz (48 x 0) |
| Memory (System) | 371.78GB (339.97GB free) |
| VM | 0% |
A/B Experiments
vsliv368:30146709
binariesv615:30325510
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythonrdcb7:31342333
6518g693:31463988
aj953862:31281341
envsactivate1:31551504
478i5457:31544283
cloudbuttont:31379625
3efgi100_wstrepl:31403338
ddidt:31399633
ec5jj548:31422691
cp_cls_t_966_ss:31526232
4je02754:31572277
8hhj4413:31478653
cp_cls_c_1081:31454833
conptydll_true:31498968
e9c30283:31461165
c9b86496:31447327
ei9d7968:31496641
chat:31457767
8hig5102:31480529
89g7j272:31518289
i2gc6536:31499202
52612955:31516516
h08i8180:31475369
ddid_t:31478206
hmra_i5g22:31518061
7df3h592:31512476
cp_cls_t_1082:31535311
logging_enabled_new:31498466
j0d79568:31499440
jb_cp_cls_t_632:31543129
748c7209:31512887
32d76977:31512328
ha629193:31508444
a1ije391_t:31540920
jbcp_cls_pctr_t:31531130
cp_intellij_t_nes:31548657
jf4hg949:31526829
ahp-both-windows:31556933
ihg5j128:31534457
7g2b5551:31542111
sandbox-ui-on-2:31543161
nes-ex-cf-euporie-03:31542868
enable_editor_pane_layout:31569726
allow-none:31555437
36h42362:31564511
c7c27ce7:31554789
1h923230:31564177
1532g621_copy:31554320
treatment-23-1:31555779
unuse_dynamic_mcp:31555281
0d8dfbc3:31570291
nemo-v2:31565334
0c1h4866:31566224
session-mark-done:31558131
5b8j3302:31564601
mangle-name-control:31572633
multiv2:31574985
2bfb8b39:31576696
permission_prompt_treatment:1332566
ccr_pr_nudge_adoption:1319471
vsc_wsm_t:1340632
jidc7660:1370295
auto_mode_control:1367906
- Linguagem predominante
- TypeScript
- Estrelas
- 2.6k
- Forks
- 805
- Merge médio
- 2d 3h
- PRs com merge (30d)
- 38
Preparar o ambiente
Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de microsoft/vscode-pull-request-github
-
Issue 3 — DocumentationAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
microsoft/vscode-pull-request-github#8792 ·
Mantenedores costumam responder em até 1 dia
-
PR description view doesn't show PR eventsTalvez já em andamento @alexr00 assumiu há 2 dias. Aberta
microsoft/vscode-pull-request-github#9051 · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
Test "Update Stack"Abertatestplan-item
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 30/100
microsoft/vscode-pull-request-github#9046 ·
Mantenedores costumam responder em até 1 dia
-
Issue links in overview HTML are emitted with an extra quote in hrefTalvez já em andamento @alexr00 assumiu há 5 dias. Abertabug
microsoft/vscode-pull-request-github#9022 · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
Colours are off for sub-buttons under Create Merge CommitTalvez já em andamento @alexr00 assumiu há 6 dias. Abertainfo-needed
microsoft/vscode-pull-request-github#9019 · 1 comentário · 1 responsável ·
Mantenedores costumam responder em até 1 dia
Todas as issues de microsoft/vscode-pull-request-github
Issues semelhantes
-
nextjs-tracking
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
cloudflare/vinext#3887 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 86/100
apache/rocketmq-dashboard#6331 ·
Mantenedores costumam responder em até 5 dias
-
bug cache clinical-safety P1-critical
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
juspay/blend-design-system#1788 ·
Mantenedores costumam responder em até 1 dia
-
[Analytics] Add Focus Time-Block Efficiency Ratio Calculator in src/lib/focus/efficiency-ratio.tsAbertaanalytics beginner friendly community contributions-welcome enhancement good first issue hacktoberfest help wanted up-for-grabs
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia