#N/A: Fix git_add rule

This commit is contained in:
Pablo Santiago Blum de Aguiar
2016-03-17 23:25:03 -03:00
parent 3a39deb485
commit 41707b80c6
3 changed files with 21 additions and 30 deletions
+3 -4
View File
@@ -5,15 +5,14 @@ from thefuck.specific.git import git_support
@git_support
def match(command):
return ('did not match any file(s) known to git.' in command.stderr
and "Did you forget to 'git add'?" in command.stderr)
return 'did not match any file(s) known to git.' in command.stderr
@git_support
def get_new_command(command):
missing_file = re.findall(
r"error: pathspec '([^']*)' "
r"did not match any file\(s\) known to git.", command.stderr)[0]
r"error: pathspec '([^']*)' "
r'did not match any file\(s\) known to git.', command.stderr)[0]
formatme = shell.and_('git add -- {}', '{}')
return formatme.format(missing_file, command.script)