This commit is contained in:
Paul Gauthier 2024-08-31 10:55:52 -07:00
parent 231a49ef91
commit b729ed3ab2

View file

@ -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