From 1a3f4041f7c175f30e9d8edf38cd87e7185f1818 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 9 Aug 2024 19:40:19 -0400 Subject: [PATCH] fix: Show undo hint only if current HEAD is not the same as commit_before_message --- aider/coders/base_coder.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index f12637397..e7642376a 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -1661,8 +1661,9 @@ class Coder: if self.show_diffs: self.commands.cmd_diff() - def show_undo_hint(self): - self.io.tool_output(f"You can use /undo to revert and discard commit {commit_hash}.") + def show_undo_hint(self, commit_hash): + if self.commit_before_message != self.repo.repo.head.commit.hexsha: + self.io.tool_output(f"You can use /undo to revert and discard commit {commit_hash}.") def dirty_commit(self): if not self.need_commit_before_edits: