From 96f15c45334f9adc138199e18239e90a283a1831 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Mon, 24 Jul 2023 13:05:00 -0300 Subject: [PATCH] Be sure to include staged files in get_tracked_files --- aider/coders/base_coder.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index 35cd6e25c..22f325922 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -1014,6 +1014,11 @@ class Coder: 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)