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:
co-authored by
Claude Opus 4.6
parent
4825661e02
commit
62a6cf38fe
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user