From d2c622e4d1c68ebff41b4d5e04684ae500d0dbea Mon Sep 17 00:00:00 2001 From: Nikos Kakonas Date: Fri, 10 Jun 2022 16:05:14 +0000 Subject: [PATCH] improve match method --- thefuck/rules/git_direct_commit.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/thefuck/rules/git_direct_commit.py b/thefuck/rules/git_direct_commit.py index 57b37785..c1db6362 100644 --- a/thefuck/rules/git_direct_commit.py +++ b/thefuck/rules/git_direct_commit.py @@ -1,6 +1,7 @@ def match(command): - return ('Untracked files' in command.output or '''use "git add"''' in command.output - or 'Changes not staged for commit' in command.output) + return 'git commit ' in command.script and ('Untracked files' in command.output + or '''use "git add"''' in command.output or 'Changes not staged for commit' + in command.output) def get_new_command(command):