mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 02:05:00 +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.test_outcome = None
|
||||||
self.edit_outcome = None
|
self.edit_outcome = None
|
||||||
if self.repo:
|
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:
|
else:
|
||||||
self.commit_before_message = None
|
self.commit_before_message = None
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue