fix(discover): honor .git/info/exclude during file discovery
Fixes #489
Problem
index_repository honored .gitignore but silently ignored .git/info/exclude — the per-clone exclude file that Git itself treats as authoritative. Any paths excluded only via info/exclude (e.g. Sandcastle worktrees) were walked in full.
In the reported case this caused the indexer to traverse 661,430 files / 170 GB of worktree content and OOM.
Solution
Added cbm_gitignore_merge() to append patterns from one matcher into another. In cbm_discover_ex, after loading .gitignore, the code now also loads .git/info/exclude and merges its patterns in. If only the exclude file exists (no .gitignore), it is used directly. No downstream call paths change.
Changes
src/discover/discover.h— declarecbm_gitignore_mergesrc/discover/gitignore.c— implementcbm_gitignore_mergesrc/discover/discover.c— load and merge.git/info/excludeincbm_discover_extests/test_gitignore.c— 3 unit tests forcbm_gitignore_mergetests/test_discover.c— 2 integration tests reproducing the issue scenario
Testing
Added discover_git_info_exclude and discover_git_info_exclude_stacks_with_gitignore to the discover suite, covering the exact reproduction case from the issue report.