mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 16:54:59 +00:00
Added --dirty-commits
This commit is contained in:
parent
a2fa4f2929
commit
4c76a8a242
3 changed files with 15 additions and 2 deletions
|
@ -218,7 +218,7 @@ class Coder:
|
|||
if is_commit_command:
|
||||
return
|
||||
|
||||
if not self.auto_commits:
|
||||
if not self.dirty_commits:
|
||||
return
|
||||
if not self.repo:
|
||||
return
|
||||
|
|
|
@ -133,6 +133,8 @@ def main(args=None, input=None, output=None):
|
|||
action="store_true",
|
||||
dest="dirty_commits",
|
||||
help="Enable dirty commit of changes",
|
||||
env_var=f"{env_prefix}DIRTY_COMMIT",
|
||||
default=True,
|
||||
)
|
||||
parser.add_argument(
|
||||
"--dry-run",
|
||||
|
@ -204,7 +206,7 @@ def main(args=None, input=None, output=None):
|
|||
use_ctags=args.ctags,
|
||||
verbose=args.verbose,
|
||||
)
|
||||
if args.auto_commits:
|
||||
if args.dirty_commits:
|
||||
coder.commit(ask=True, prefix="wip: ", which="repo_files")
|
||||
|
||||
if args.apply:
|
||||
|
|
|
@ -51,6 +51,7 @@ class TestMain(TestCase):
|
|||
with patch("aider.main.Coder") as MockCoder:
|
||||
main([])
|
||||
_, kwargs = MockCoder.call_args
|
||||
assert kwargs["dirty_commits"] is True
|
||||
assert kwargs["auto_commits"] is True
|
||||
assert kwargs["pretty"] is True
|
||||
|
||||
|
@ -63,3 +64,13 @@ class TestMain(TestCase):
|
|||
main(["--pretty"])
|
||||
_, kwargs = MockCoder.call_args
|
||||
assert kwargs["pretty"] is True
|
||||
|
||||
with patch("aider.main.Coder") as MockCoder:
|
||||
main(["--no-dirty-commits"])
|
||||
_, kwargs = MockCoder.call_args
|
||||
assert kwargs["dirty_commits"] is False
|
||||
|
||||
with patch("aider.main.Coder") as MockCoder:
|
||||
main(["--dirty-commits"])
|
||||
_, kwargs = MockCoder.call_args
|
||||
assert kwargs["dirty_commits"] is True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue