mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 22:34:59 +00:00
get tracked files by traversing the tree
This commit is contained in:
parent
73f5fb05e5
commit
68c26a60ef
2 changed files with 20 additions and 13 deletions
|
@ -971,8 +971,15 @@ class Coder:
|
|||
if not self.repo:
|
||||
return []
|
||||
|
||||
files = self.repo.git.execute(["git", "-c", "core.quotepath=off", "ls-files"])
|
||||
files = set(files.splitlines())
|
||||
try:
|
||||
commit = self.repo.head.commit
|
||||
except ValueError:
|
||||
return set()
|
||||
|
||||
files = []
|
||||
for blob in commit.tree.traverse():
|
||||
if blob.type == "blob": # blob is a file
|
||||
files.append(blob.path)
|
||||
|
||||
# convert to appropriate os.sep, since git always normalizes to /
|
||||
res = set(str(Path(PurePosixPath(path))) for path in files)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue