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.")
return
try:
current_head = self.coder.repo.repo.head.commit.hexsha
except ValueError:
current_head = self.coder.repo.get_head()
if current_head is None:
self.io.tool_error("Unable to get current commit. The repository might be empty.")
return