Do not autocommit after add if autocommit is disabled

This commit is contained in:
Omri Bloch 2023-11-01 10:28:45 +02:00
parent e4e14df503
commit e8c4b3cf81

View file

@ -327,7 +327,7 @@ class Commands:
self.io.tool_output(f"Added {matched_file} to the chat") self.io.tool_output(f"Added {matched_file} to the chat")
added_fnames.append(matched_file) added_fnames.append(matched_file)
if self.coder.repo and git_added: if self.coder.repo and git_added and self.coder.auto_commits:
git_added = " ".join(git_added) git_added = " ".join(git_added)
commit_message = f"aider: Added {git_added}" commit_message = f"aider: Added {git_added}"
self.coder.repo.commit(message=commit_message) self.coder.repo.commit(message=commit_message)