fix: use get_head() in init_before_message

This commit is contained in:
Paul Gauthier (aider) 2024-08-09 19:42:46 -04:00
parent a120cf37d9
commit d5ff8929fb

View file

@ -670,11 +670,7 @@ class Coder:
self.test_outcome = None
self.edit_outcome = None
if self.repo:
try:
self.commit_before_message = self.repo.repo.head.commit.hexsha
except ValueError:
# This occurs when the repository is brand new and has no commits
self.commit_before_message = None
self.commit_before_message = self.repo.get_head()
else:
self.commit_before_message = None