use safe repo.get_head methods

This commit is contained in:
Paul Gauthier 2024-08-31 07:29:51 -07:00
parent 8678a6455f
commit d2acb9c3b0
3 changed files with 28 additions and 12 deletions

View file

@ -713,7 +713,7 @@ class Coder:
self.shell_commands = []
if self.repo:
self.commit_before_message.append(self.repo.get_head())
self.commit_before_message.append(self.repo.get_head_sha())
def run(self, with_message=None, preproc=True):
try:
@ -1867,7 +1867,7 @@ class Coder:
def show_undo_hint(self):
if not self.commit_before_message:
return
if self.commit_before_message[-1] != self.repo.get_head():
if self.commit_before_message[-1] != self.repo.get_head_sha():
self.io.tool_output("You can use /undo to undo and discard each aider commit.")
def dirty_commit(self):