From b729ed3ab2de6de690bf9b6fa40a2c3b330d94c5 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Sat, 31 Aug 2024 10:55:52 -0700 Subject: [PATCH] fix --- aider/commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/commands.py b/aider/commands.py index d5f4d0a7f..7cc8d2264 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -426,6 +426,7 @@ class Commands: return last_commit_hash = self.coder.repo.get_head_commit_sha(short=True) + last_commit_message = self.coder.repo.get_head_commit_message("(unknown)").strip() if last_commit_hash not in self.coder.aider_commit_hashes: self.io.tool_error("The last commit was not made by aider in this chat session.") self.io.tool_error( @@ -499,7 +500,6 @@ class Commands: # Move the HEAD back before the latest commit self.coder.repo.repo.git.reset("--soft", "HEAD~1") - last_commit_message = self.coder.repo.get_head_commit_message("(unknown)").strip() self.io.tool_output(f"Removed: {last_commit_hash} {last_commit_message}") # Get the current HEAD after undo