Repository navigation
Description
Description
First-run discovery (config::discover, crates/dashboard-core/src/config.rs:227) keeps only folders whose .git is a directory. Its comment says a .git file means a linked worktree. A primary checkout made with git init --separate-git-dir or git clone --separate-git-dir also has a .git file (gitdir: <path>), but its git directory has no commondir, so it is not a worktree.
Reproduced on b6b5450 with a synthetic temporary root on Windows (git 2.55): plain (from git init) and separate (from git init --separate-git-dir <tmp>/gitdirs/sep.git), each with an origin remote. pmd::checkout_identity reads both (hemsoft-dev/plain, hemsoft-dev/separate), but Config::load_or_create_in(dir, root) writes only plain. Control: plain is found. The existing first_run_discovers_checkouts_one_level_under_the_root_and_writes_them test in crates/dashboard-core/tests/storage.rs still correctly skips the linked worktree alpha.worktrees/pr-1.
Why
A checkout the dashboard can read is missing from the first-run list. Nothing marks the gap, so the user has to notice and add it by hand.
Goal
First-run discovery includes primary checkouts whose .git is a gitdir: file pointing at a non-worktree git directory, and still skips linked worktrees.
Acceptance Criteria
- A direct child whose
.gitfile points at a git directory withoutcommondiris discovered. - A linked worktree (its git directory has
commondir) is still skipped, as are plain folders and checkouts two levels down. - A
.gitfile that is unreadable, has nogitdir:line, or points at a missing directory is skipped without panic. - Discovery still reads no git subprocess (
dashboard-core/tests/no_child_process.rsstays green) and the result stays sorted. - The
discoverdoc comment matches the new rule.
Definition of Done
- Fix and tests in
dashboard-core, using fixture folders (no git required in the test), covering the separate-git-dir, linked-worktree and malformed.gitfile cases. -
cargo fmt --all --check,cargo clippy --workspace --all-targets --locked -- -D warnings,cargo test --workspace --lockedandcargo deny --locked check advisoriespass. - Clean current-head AI review.
Validation
-
cargo test -p dashboard-core --locked --test storagepasses, including a case whereroot/separate/.gitcontainsgitdir: <tmp>/gitdirs/sep.git(a directory withconfigand nocommondir) andConfig::load_or_create_inlistsroot/separate. - The same test still excludes
root/alpha.worktrees/pr-1.
Activity