Skip to content

fix: honor .git/info/exclude at the search root - #330

Open
nitayk wants to merge 1 commit into
MinishLab:mainfrom
nitayk:fix/honor-git-info-exclude
Open

nitayk wants to merge 1 commit into
MinishLab:mainfrom
nitayk:fix/honor-git-info-exclude

Conversation

@nitayk

@nitayk nitayk commented Nov 18, 2026

Copy link
Copy Markdown

Closes #329.

semble reads .gitignore and .sembleignore but not .git/info/exclude, which git also honors. Tools such as Claude Code list nested worktrees (.claude/worktrees/) only in info/exclude, so searching a repo's main checkout returned duplicate hits from every worktree copy: in one real repo, 5 of the top 8 results.

This change reads info/exclude for the search root and applies it before the root .gitignore, the same order git uses. In a worktree, .git is a file, so it follows gitdir: and commondir to the shared git folder. It does not call the git binary. A search started inside a worktree still returns that worktree's files.

Tests cover a normal repo, a worktree .git file and no .git; they fail without the change. make lint, make typecheck and make test pass (401 tests, coverage 100%).

🤖 Generated with Claude Code

The walker read only .gitignore and .sembleignore, so paths excluded via
.git/info/exclude (for example nested worktrees under .claude/worktrees/)
were indexed and returned as duplicate hits. Read the root repo's
info/exclude, following a worktree's .git file to the common git dir.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Files listed in .git/info/exclude are indexed (nested worktree copies show up as duplicates)

1 participant