Skip to content

fix(git): index_repository ignores .git/info/exclude and core.excludesFile inside linked git worktrees #689

Description

@lg320531124

Bug

When a repository is a linked git worktree, index_repository does not honor:

  1. .git/info/exclude — the per-repo local exclude rules
  2. core.excludesFile — the global git config pointing to a custom ignore file

This causes files that should be ignored (build artifacts, IDE configs, etc.) to be indexed, bloating the graph and returning irrelevant search results.

Context

Linked worktrees have a .git file (not directory) pointing to the main worktree's git dir. The exclude resolution path differs from regular repos:

  • Regular: .git/info/exclude.gitignorecore.excludesFile
  • Worktree: .git → read pointer → .git/worktrees/<name>/info/exclude

Related

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingduplicateThis issue or pull request already existspriority/normalStandard review queue; useful PR with ordinary maintainer urgency.ux/behaviorDisplay bugs, docs, adoption UX

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions