mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 22:34:59 +00:00
notify when preparing dirty commit; skip if /exit or /commit is input
This commit is contained in:
parent
fde537cd7f
commit
967cb1bd8d
2 changed files with 17 additions and 5 deletions
|
@ -402,9 +402,13 @@ class Coder:
|
|||
return
|
||||
|
||||
def should_dirty_commit(self, inp):
|
||||
is_commit_command = inp and inp.startswith("/commit")
|
||||
if is_commit_command:
|
||||
return
|
||||
cmds = self.commands.matching_commands(inp)
|
||||
if cmds:
|
||||
matching_commands, _, _ = cmds
|
||||
if len(matching_commands) == 1:
|
||||
cmd = matching_commands[0]
|
||||
if cmd in ("/exit", "/commit"):
|
||||
return
|
||||
|
||||
if not self.dirty_commits:
|
||||
return
|
||||
|
@ -436,6 +440,7 @@ class Coder:
|
|||
self.num_control_c = 0
|
||||
|
||||
if self.should_dirty_commit(inp):
|
||||
self.io.tool_output("Git repo has uncommitted changes, preparing commit...")
|
||||
self.commit(ask=True, which="repo_files")
|
||||
|
||||
# files changed, move cur messages back behind the files messages
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue