diff --git a/aider/coder.py b/aider/coder.py index f74799ac4..c1275ec17 100755 --- a/aider/coder.py +++ b/aider/coder.py @@ -461,14 +461,11 @@ class Coder: return commit_message - def get_diffs(self, *final_args): - args = ["HEAD"] + def get_diffs(self, *args): if self.pretty: - args += ["--color"] - args += final_args + args = ["--color"] + list(args) diffs = self.repo.git.diff(*args) - return diffs def commit(self, history=None, prefix=None, ask=False, message=None, which="chat_files"): @@ -496,7 +493,7 @@ class Coder: if not current_branch_commit_count: continue - these_diffs = self.get_diffs("--", relative_fname) + these_diffs = self.get_diffs("HEAD", "--", relative_fname) if these_diffs: diffs += these_diffs + "\n" diff --git a/aider/commands.py b/aider/commands.py index 95af6958f..dad0de4f5 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -131,10 +131,6 @@ class Commands: commits = f"{self.coder.last_aider_commit_hash}~1" diff = self.coder.get_diffs(commits, self.coder.last_aider_commit_hash) - if self.coder.pretty: - diff = self.coder.repo.git.diff(commits, "--color", self.coder.last_aider_commit_hash) - else: - diff = self.coder.repo.git.diff(commits, self.coder.last_aider_commit_hash) # don't use io.tool() because we don't want to log or further colorize print(diff)