Collection new-session flow treats parent folder as a Git repository
- 主要语言
- 没有语言数据
- 星标
- 2.1k
- 派生
- 153
- PR 合并指标
- 30 天内没有已合并 PR
描述
## Affected version
GitHub Copilot app 1.1.14 on macOS 26.6.2.
## What happened?
A parent folder with no `.git` directory contains three direct child Git repositories, all on `main`. After adding the parent through **Projects -> + -> Open folder**, the app correctly registers it as a collection.
Opening **New session** for the collection shows generic single-repository controls (Project: collection name, Workspace: New worktree, Branch: main). The child repositories are not listed, so their branches and checkout modes cannot be selected.
Logs show the branch resolver targeting the non-Git parent:
```
Failed to get current branch path=~/gitrepos/spec-forge-all
error=git ["symbolic-ref", "HEAD"] failed:
fatal: not a git repository (or any of the parent directories): .git
```
The same failure occurs for `git worktree list`, `for-each-ref`, and `git fetch` against the parent.
## Steps to reproduce
1. Create a parent folder containing multiple direct child Git repositories, with no `.git` at the parent.
2. Add the parent using **Projects -> + -> Open folder**.
3. Click **New session** for the collection.
4. Observe one branch selector for the parent and no child-repository list.
## Expected behavior
Enumerate collection members and allow branch/checkout selection for each child. Run Git branch commands against each child, not the parent folder.
## Additional context
**Local repository** is a partial workaround but does not restore isolated multi-repository worktrees or per-repository branch selection. Related but narrower: #786 covers per-repository default branches.
贡献指南
调研方向
首先跟踪 collection 的 New session 流程以及日志中显示的 branch resolver,然后使用一个包含三个直接子 repository 且没有父级 .git 目录的父文件夹进行复现。完成标准是:子 repository 会以每个 repository 各自的 branch 和 checkout 选项列出,并且 Git branch、worktree、ref 和 fetch 命令会针对每个子 repository 执行,而不是针对父 repository 执行。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- git
- 领域
- desktop, tooling
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 活跃
- 描述清晰度
- 描述清楚
- 新手友好度
- 72/100