mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-08 12:20:38 -07: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