Skip to content

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

Closed as not planned

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 → .gitignore → core.excludesFile
  • Worktree: .git → read pointer → .git/worktrees/<name>/info/exclude

Related

Activity

  1. added a commit that references this issue on Jun 29, 2026
    1702afa
  2. added
    priority/normalStandard review queue; useful PR with ordinary maintainer urgency.
    on Jun 30, 2026
  3. added 2 commits that reference this issue on Jul 1, 2026
    2333563
    5d7315a
  4. added
    duplicateThis issue or pull request already exists
    ux/behaviorDisplay bugs, docs, adoption UX
    on Jul 1, 2026
  5. github-actions commented on Jul 1, 2026

    @github-actions

    Thanks for raising this! It looks like a duplicate of an existing issue — the canonical one is linked above. Continuing the discussion there keeps everything in one place. We leave this open for visibility; a maintainer will close it once it's fully covered.

  6. DeusData commented on Jul 1, 2026

    @DeusData
    Owner

    Thanks. This duplicates #682, which is the canonical linked-worktree exclude handling issue. The related fix PRs are #683 and #695, so I am closing this duplicate to keep the discussion and status consolidated.

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