From 34fac7b4b9d619b091029a86f61d37eaf14e1063 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 11 May 2023 09:28:36 -0700 Subject: [PATCH] Fixed a bug where the commit command was being triggered when the repo was dirty. --- aider/coder.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aider/coder.py b/aider/coder.py index e3576a7ee..01ddc395e 100755 --- a/aider/coder.py +++ b/aider/coder.py @@ -192,7 +192,9 @@ class Coder: self.num_control_c = 0 - if self.repo and self.repo.is_dirty(): + is_commit_command = (inp and inp.startswith('/commit')) + + if self.repo and self.repo.is_dirty() not is_commit_command: self.commit(ask=True, which="repo_files") # files changed, move cur messages back behind the files messages