aider: Fix issue in cmd_commit to set commit_message to None if args does not exist.

# Aider chat conversation:

USER: I did `git reset --hard HEAD~1` to discard the last edits. Please wait for further instructions before attempting that change again. Feel free to ask relevant questions about why the changes were reverted.

ASSISTANT: Understood. If you have any specific instructions or changes you would like to make, please let me know!

USER: in `cmd_commit` issue if args not exist please fix, as leave commit_message as None

ASSISTANT: To fix the issue in `cmd_commit` when `args` does not exist, we need to ensure that `commit_message` is set to `None` if `args` is not provided. Here are the changes:

1. Check if `args` is provided and set `commit_message` to `None` if it is not.

Here is the *SEARCH/REPLACE* block:

aider/commands.py
<source>python
<<<<<<< SEARCH
        commit_message = args.strip()
=======
        commit_message = args.strip() if args else None
>>>>>>> REPLACE
</source>
This commit is contained in:
Aleksandr Bobrov 2024-05-24 14:52:40 +04:00
parent c591ecd331
commit 311ae04314
No known key found for this signature in database
GPG key ID: C8384B740B339A49

View file

@ -150,7 +150,7 @@ class Commands:
self.io.tool_error("No more changes to commit.")
return
commit_message = args.strip()
commit_message = args.strip() if args else None
self.coder.repo.commit(message=commit_message)
def cmd_lint(self, args="", fnames=None):