mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-06 04:35:00 +00:00
feat: add --auto-commit-message argument to control auto-commit message generation
This commit is contained in:
parent
57020a2d5e
commit
1f3a9cf984
4 changed files with 44 additions and 4 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue