feat(git): Refactor gitignore handling to use ignore library instead of minimatch (#864)

This commit is contained in:
N. Taylor Mullen
2025-06-08 18:32:19 -07:00
committed by GitHub
parent d061419452
commit 72fa01f62d
6 changed files with 65 additions and 238 deletions

View File

@@ -140,33 +140,6 @@ describe('FileDiscoveryService', () => {
});
});
describe('getIgnoreInfo', () => {
beforeEach(async () => {
await service.initialize();
});
it('should return git ignored patterns', () => {
const info = service.getIgnoreInfo();
expect(info.gitIgnored).toEqual(['.git/**', 'node_modules/**']);
});
it('should return empty arrays when git ignore parser is not initialized', async () => {
const uninitializedService = new FileDiscoveryService(mockProjectRoot);
const info = uninitializedService.getIgnoreInfo();
expect(info.gitIgnored).toEqual([]);
});
it('should handle git ignore parser returning null patterns', async () => {
mockGitIgnoreParser.getIgnoredPatterns.mockReturnValue([] as string[]);
const info = service.getIgnoreInfo();
expect(info.gitIgnored).toEqual([]);
});
});
describe('isGitRepository', () => {
it('should return true when isGitRepo is explicitly set to true in options', () => {
const result = service.isGitRepository({ isGitRepo: true });