mirror of
https://github.com/nvbn/thefuck.git
synced 2025-01-18 20:11:17 +00:00
Update stderr wording of git_not_command
This changed in git v2.13.1, see
6c48686263 (diff-081cf476dd9ac3b05c183570de47cb23)
This commit is contained in:
parent
e62666181a
commit
76600cf40a
@ -7,7 +7,7 @@ from tests.utils import Command
|
||||
def git_not_command():
|
||||
return """git: 'brnch' is not a git command. See 'git --help'.
|
||||
|
||||
Did you mean this?
|
||||
The most similar command is
|
||||
branch
|
||||
"""
|
||||
|
||||
@ -16,7 +16,7 @@ branch
|
||||
def git_not_command_one_of_this():
|
||||
return """git: 'st' is not a git command. See 'git --help'.
|
||||
|
||||
Did you mean one of these?
|
||||
The most similar commands are
|
||||
status
|
||||
reset
|
||||
stage
|
||||
@ -29,7 +29,7 @@ stats
|
||||
def git_not_command_closest():
|
||||
return '''git: 'tags' is not a git command. See 'git --help'.
|
||||
|
||||
Did you mean one of these?
|
||||
The most similar commands are
|
||||
\tstage
|
||||
\ttag
|
||||
'''
|
||||
|
@ -6,12 +6,12 @@ from thefuck.specific.git import git_support
|
||||
@git_support
|
||||
def match(command):
|
||||
return (" is not a git command. See 'git --help'." in command.stderr
|
||||
and 'Did you mean' in command.stderr)
|
||||
and 'The most similar command' in command.stderr)
|
||||
|
||||
|
||||
@git_support
|
||||
def get_new_command(command):
|
||||
broken_cmd = re.findall(r"git: '([^']*)' is not a git command",
|
||||
command.stderr)[0]
|
||||
matched = get_all_matched_commands(command.stderr)
|
||||
matched = get_all_matched_commands(command.stderr, 'The most similar command')
|
||||
return replace_command(command, broken_cmd, matched)
|
||||
|
Loading…
x
Reference in New Issue
Block a user