mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 16:57:46 +00:00
fix: prevent RangeError in GitIgnoreParser for root paths (#3417)
Co-authored-by: Jacob Richman <jacob314@gmail.com>
This commit is contained in:
@@ -61,7 +61,12 @@ export class GitIgnoreParser implements GitIgnoreFilter {
|
||||
? path.relative(this.projectRoot, filePath)
|
||||
: filePath;
|
||||
|
||||
if (relativePath === '' || relativePath.startsWith('..')) {
|
||||
if (
|
||||
relativePath === '' ||
|
||||
relativePath.startsWith('..') ||
|
||||
relativePath === '/' ||
|
||||
relativePath.startsWith('/')
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user