Merge pull request #310 from omri123/autocommit-bugfix

Do not autocommit after add if autocommit is disabled
This commit is contained in:
paul-gauthier 2023-11-02 09:40:15 -07:00 committed by GitHub
commit b507ea087f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -327,7 +327,7 @@ class Commands:
self.io.tool_output(f"Added {matched_file} to the chat")
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)
commit_message = f"aider: Added {git_added}"
self.coder.repo.commit(message=commit_message)