feat: add --auto-commit-message argument to control auto-commit message generation

This commit is contained in:
Derrick Hammer (aider) 2025-05-12 08:18:20 -04:00 committed by Derrick Hammer
parent 57020a2d5e
commit 1f3a9cf984
4 changed files with 44 additions and 4 deletions

View file

@ -1403,6 +1403,34 @@ This command will print 'Hello, World!' to the console."""
# (because user rejected the changes)
mock_editor.run.assert_not_called()
def test_auto_commit_message_flag(self):
with GitTemporaryDirectory():
repo = git.Repo()
fname = Path("test.txt")
fname.touch()
# Test with auto_commit_message=True (default)
io = InputOutput(yes=True)
coder = Coder.create(
self.GPT35,
"diff",
io=io,
fnames=[str(fname)],
auto_commit_message=True,
)
assert coder.repo.auto_commit_message is True
# Test with auto_commit_message=False
io = InputOutput(yes=True)
coder = Coder.create(
self.GPT35,
"diff",
io=io,
fnames=[str(fname)],
auto_commit_message=False,
)
assert coder.repo.auto_commit_message is False
if __name__ == "__main__":
unittest.main()