From 335ae406759f160b0aa82af57770ccc9641b1de0 Mon Sep 17 00:00:00 2001 From: ik1ne <3996272+ik1ne@users.noreply.github.com> Date: Tue, 20 Aug 2019 04:45:55 +0900 Subject: [PATCH] Fix: rules.git_checkout not working with git 2.22.0 (#934) * Change: remove period from git checkout error output. * Change: remove period from git checkout get_new_command. --- thefuck/rules/git_checkout.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/thefuck/rules/git_checkout.py b/thefuck/rules/git_checkout.py index 65705f4..b500652 100644 --- a/thefuck/rules/git_checkout.py +++ b/thefuck/rules/git_checkout.py @@ -8,7 +8,7 @@ from thefuck.shells import shell @git_support def match(command): - return ('did not match any file(s) known to git.' in command.output + return ('did not match any file(s) known to git' in command.output and "Did you forget to 'git add'?" not in command.output) @@ -29,7 +29,7 @@ def get_branches(): def get_new_command(command): missing_file = re.findall( r"error: pathspec '([^']*)' " - r"did not match any file\(s\) known to git.", command.output)[0] + r"did not match any file\(s\) known to git", command.output)[0] closest_branch = utils.get_closest(missing_file, get_branches(), fallback_to_first=False) if closest_branch: