mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-16 00:51:25 -07:00
fix(core): Preserve escaped characters in gitignore patterns (#11171)
Co-authored-by: Jacob Richman <jacob314@gmail.com>
This commit is contained in:
@@ -234,4 +234,20 @@ src/*.tmp
|
||||
);
|
||||
});
|
||||
});
|
||||
describe('Escaped Characters', () => {
|
||||
beforeEach(async () => {
|
||||
await setupGitRepo();
|
||||
});
|
||||
|
||||
it('should correctly handle escaped characters in .gitignore', async () => {
|
||||
await createTestFile('.gitignore', '\\#foo\n\\!bar');
|
||||
// Create files with special characters in names
|
||||
await createTestFile('bla/#foo', 'content');
|
||||
await createTestFile('bla/!bar', 'content');
|
||||
|
||||
// These should be ignored based on the escaped patterns
|
||||
expect(parser.isIgnored('bla/#foo')).toBe(true);
|
||||
expect(parser.isIgnored('bla/!bar')).toBe(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user