mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-05 20:25:01 +00:00
feat: add error handling for git operations in auto_commit method
This commit is contained in:
parent
8d0f7daa3a
commit
cef78282bd
1 changed files with 14 additions and 10 deletions
|
@ -1859,6 +1859,7 @@ class Coder:
|
||||||
if not context:
|
if not context:
|
||||||
context = self.get_context_from_history(self.cur_messages)
|
context = self.get_context_from_history(self.cur_messages)
|
||||||
|
|
||||||
|
try:
|
||||||
res = self.repo.commit(fnames=edited, context=context, aider_edits=True)
|
res = self.repo.commit(fnames=edited, context=context, aider_edits=True)
|
||||||
if res:
|
if res:
|
||||||
self.show_auto_commit_outcome(res)
|
self.show_auto_commit_outcome(res)
|
||||||
|
@ -1870,6 +1871,9 @@ class Coder:
|
||||||
|
|
||||||
self.io.tool_output("No changes made to git tracked files.")
|
self.io.tool_output("No changes made to git tracked files.")
|
||||||
return self.gpt_prompts.files_content_gpt_no_edits
|
return self.gpt_prompts.files_content_gpt_no_edits
|
||||||
|
except ANY_GIT_ERROR as err:
|
||||||
|
self.io.tool_error(f"Git error during auto-commit: {str(err)}")
|
||||||
|
return None
|
||||||
|
|
||||||
def show_auto_commit_outcome(self, res):
|
def show_auto_commit_outcome(self, res):
|
||||||
commit_hash, commit_message = res
|
commit_hash, commit_message = res
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue