put back caching, add debug output

This commit is contained in:
Paul Gauthier 2023-10-18 12:11:07 -07:00
parent d1cd0f9860
commit b87c9f14fb
2 changed files with 12 additions and 5 deletions

View file

@ -206,11 +206,16 @@ class GitRepo:
if not self.aider_ignore_file or not self.aider_ignore_file.is_file():
return fnames
lines = self.aider_ignore_file.read_text().splitlines()
self.aider_ignore_spec = pathspec.PathSpec.from_lines(
pathspec.patterns.GitWildMatchPattern,
lines,
)
mtime = self.aider_ignore_file.stat().st_mtime
dump(mtime)
if mtime != self.aider_ignore_ts:
self.aider_ignore_ts = mtime
lines = self.aider_ignore_file.read_text().splitlines()
self.aider_ignore_spec = pathspec.PathSpec.from_lines(
pathspec.patterns.GitWildMatchPattern,
lines,
)
return [fname for fname in fnames if not self.aider_ignore_spec.match_file(fname)]