Fix .gitignore support and Windows path separator bug in scanner

Normalize paths to forward slashes in matchesGlob() and scanDirectory()
so glob exclude patterns work on Windows. Add getGitIgnoredDirectories()
using git ls-files to skip .gitignore'd directories during indexing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Colby McHenry
2026-02-10 04:08:10 -06:00
co-authored by Claude Opus 4.6
parent 4825661e02
commit 62a6cf38fe
4 changed files with 158 additions and 3 deletions
+8
View File
@@ -74,6 +74,14 @@ export function clamp(value: number, min: number, max: number): number {
return Math.max(min, Math.min(max, value));
}
/**
* Normalize a file path to use forward slashes.
* Fixes Windows backslash paths so glob matching works consistently.
*/
export function normalizePath(filePath: string): string {
return filePath.replace(/\\/g, '/');
}
/**
* Cross-process file lock using lock files.
* Prevents concurrent database writes from CLI, MCP server, and git hooks.