Skip to content

fix: fall back to main repo index for fresh worktrees - #63

Merged
Helweg merged 24 commits into
mainfrom
feat/issue-60-worktree-index-fallback
Apr 27, 2026
Merged

fix: fall back to main repo index for fresh worktrees#63
Helweg merged 24 commits into
mainfrom
feat/issue-60-worktree-index-fallback

Conversation

@Helweg

@Helweg Helweg commented Apr 22, 2026

Copy link
Copy Markdown
Owner

Summary

Make fresh git worktrees reuse the main repository's project-scoped .opencode config and index when the worktree does not yet have its own local .opencode state.

Changes

  • add git/worktree root resolution so worktrees can detect their main repository root from gitdir + commondir
  • add shared project config/index path helpers and use them in config loading and indexer path selection
  • apply the same fallback behavior to eval runs and add regression coverage for inherited-vs-local worktree behavior

Testing

How were these changes tested?

  • Unit tests added/updated
  • Manual testing performed
  • Build passes (npm run build)
  • Typecheck passes (npm run typecheck)
  • Tests pass (npm run test:run)
  • Lint passes (npm run lint)

Additional verification:

  • Local targeted regression run: npx vitest run tests/git.test.ts tests/worktree-fallback.test.ts tests/eval-runner.test.ts
  • PR CI passed cargo fmt --check, cargo clippy -- -D warnings, cargo test, native build, npm run build:ts, npm run typecheck, npm run lint, npm run test:coverage, and npm run eval:smoke

Release Labels

  • Added at least one release category label (feature, bug, performance, documentation, dependencies, refactor, test, chore, or skip-changelog)
  • Added at most one semver label (semver:major, semver:minor, semver:patch) when needed

Related Issues

Fixes #60

@github-actions github-actions Bot added the test Test changes label Apr 22, 2026
@Helweg Helweg added enhancement New feature or request semver:patch Bug fix or patch labels Apr 22, 2026
@Helweg Helweg closed this in #65 Apr 25, 2026
@Helweg Helweg reopened this Apr 25, 2026
@Helweg
Helweg merged commit a8dba04 into main Apr 27, 2026
3 checks passed
@Helweg
Helweg deleted the feat/issue-60-worktree-index-fallback branch June 23, 2026 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request semver:patch Bug fix or patch test Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Fall back gracefully with git worktrees

1 participant