refactor: Use get_head() in cmd_diff

This commit is contained in:
Paul Gauthier (aider) 2024-08-09 19:44:31 -04:00
parent d5ff8929fb
commit 0b4a3d7b3c

View file

@ -471,9 +471,8 @@ class Commands:
self.io.tool_error("No git repository found.") self.io.tool_error("No git repository found.")
return return
try: current_head = self.coder.repo.get_head()
current_head = self.coder.repo.repo.head.commit.hexsha if current_head is None:
except ValueError:
self.io.tool_error("Unable to get current commit. The repository might be empty.") self.io.tool_error("Unable to get current commit. The repository might be empty.")
return return