diff --git a/aider/repo.py b/aider/repo.py index 5ae06baed..0615e3b39 100644 --- a/aider/repo.py +++ b/aider/repo.py @@ -154,6 +154,11 @@ class GitRepo: if blob.type == "blob": # blob is a file files.append(blob.path) + # Add staged files + index = self.repo.index + staged_files = [item.a_path for item in index.diff("HEAD")] + files.extend(staged_files) + # convert to appropriate os.sep, since git always normalizes to / res = set(str(Path(PurePosixPath(path))) for path in files)