mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 14:25:00 +00:00
put back caching, add debug output
This commit is contained in:
parent
d1cd0f9860
commit
b87c9f14fb
2 changed files with 12 additions and 5 deletions
|
@ -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)]
|
||||
|
||||
|
|
|
@ -204,6 +204,7 @@ class TestRepo(unittest.TestCase):
|
|||
self.assertIn(str(fname2), fnames)
|
||||
|
||||
aiderignore.write_text("new.txt\n")
|
||||
dump(aiderignore.read_text())
|
||||
|
||||
# new.txt should be gone!
|
||||
fnames = git_repo.get_tracked_files()
|
||||
|
@ -211,6 +212,7 @@ class TestRepo(unittest.TestCase):
|
|||
self.assertIn(str(fname2), fnames)
|
||||
|
||||
aiderignore.write_text("new2.txt\n")
|
||||
dump(aiderignore.read_text())
|
||||
|
||||
# new2.txt should be gone!
|
||||
fnames = git_repo.get_tracked_files()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue