From e9ec7056a1a61f75a365821f7d8fdcb0f4bd3fe2 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Tue, 2 Jan 2024 08:50:24 -0800 Subject: [PATCH] Refactor dirty_files calculation to only include files in the index. --- aider/commands.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/aider/commands.py b/aider/commands.py index 391dc2a16..b1e3699bb 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -188,8 +188,11 @@ class Commands: last_commit = self.coder.repo.repo.head.commit changed_files_last_commit = {item.a_path for item in last_commit.diff(None)} - dirty_files = self.coder.repo.repo.untracked_files + [item.a_path for item in self.coder.repo.repo.index.diff(None)] + dirty_files = [item.a_path for item in self.coder.repo.repo.index.diff(None)] dirty_files_in_last_commit = changed_files_last_commit.intersection(dirty_files) + dump(changed_files_last_commit) + dump(dirty_files) + dump(dirty_files_in_last_commit) if dirty_files_in_last_commit: self.io.tool_error(