mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 17:24:59 +00:00
fix: handle case of brand new repository with no commits
This commit is contained in:
parent
423b6e1ad1
commit
d9e7d64235
1 changed files with 5 additions and 1 deletions
|
@ -670,7 +670,11 @@ class Coder:
|
|||
self.test_outcome = None
|
||||
self.edit_outcome = None
|
||||
if self.repo:
|
||||
self.commit_before_message = self.repo.repo.head.commit.hexsha
|
||||
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
|
||||
else:
|
||||
self.commit_before_message = None
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue