mirror of
https://github.com/nvbn/thefuck.git
synced 2025-01-31 10:11:14 +00:00
Remove now redundant checks in git_*
rules
This commit is contained in:
parent
903abff77e
commit
98a9fb3d7d
@ -4,8 +4,7 @@ from thefuck import utils, shells
|
||||
|
||||
@utils.git_support
|
||||
def match(command, settings):
|
||||
return ('git' in command.script
|
||||
and 'did not match any file(s) known to git.' in command.stderr
|
||||
return ('did not match any file(s) known to git.' in command.stderr
|
||||
and "Did you forget to 'git add'?" in command.stderr)
|
||||
|
||||
|
||||
|
@ -3,7 +3,7 @@ from thefuck import utils
|
||||
|
||||
@utils.git_support
|
||||
def match(command, settings):
|
||||
return ('git branch -d' in command.script
|
||||
return ('branch -d' in command.script
|
||||
and 'If you are sure you want to delete it' in command.stderr)
|
||||
|
||||
|
||||
|
@ -4,7 +4,7 @@ from thefuck import utils, shells
|
||||
@utils.git_support
|
||||
def match(command, settings):
|
||||
# catches "git branch list" in place of "git branch"
|
||||
return command.script.split() == 'git branch list'.split()
|
||||
return command.script.split()[1:] == 'branch list'.split()
|
||||
|
||||
|
||||
@utils.git_support
|
||||
|
@ -5,8 +5,7 @@ from thefuck import shells, utils
|
||||
|
||||
@utils.git_support
|
||||
def match(command, settings):
|
||||
return ('git' in command.script
|
||||
and 'did not match any file(s) known to git.' in command.stderr
|
||||
return ('did not match any file(s) known to git.' in command.stderr
|
||||
and "Did you forget to 'git add'?" not in command.stderr)
|
||||
|
||||
|
||||
|
@ -3,8 +3,7 @@ from thefuck import utils
|
||||
|
||||
@utils.git_support
|
||||
def match(command, settings):
|
||||
return ('git' in command.script and
|
||||
'diff' in command.script and
|
||||
return ('diff' in command.script and
|
||||
'--staged' not in command.script)
|
||||
|
||||
|
||||
|
@ -4,8 +4,7 @@ from thefuck.utils import get_closest, git_support
|
||||
|
||||
@git_support
|
||||
def match(command, settings):
|
||||
return ('git' in command.script
|
||||
and " is not a git command. See 'git --help'." in command.stderr
|
||||
return (" is not a git command. See 'git --help'." in command.stderr
|
||||
and 'Did you mean' in command.stderr)
|
||||
|
||||
|
||||
|
@ -3,8 +3,7 @@ from thefuck import shells, utils
|
||||
|
||||
@utils.git_support
|
||||
def match(command, settings):
|
||||
return ('git' in command.script
|
||||
and 'pull' in command.script
|
||||
return ('pull' in command.script
|
||||
and 'set-upstream' in command.stderr)
|
||||
|
||||
|
||||
|
@ -1,11 +1,9 @@
|
||||
import re
|
||||
from thefuck import utils, shells
|
||||
from thefuck import utils
|
||||
|
||||
|
||||
@utils.git_support
|
||||
def match(command, settings):
|
||||
return ('git pull' in command.script
|
||||
and 'fatal: Not a git repository' in command.stderr
|
||||
return ('fatal: Not a git repository' in command.stderr
|
||||
and "Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set)." in command.stderr)
|
||||
|
||||
|
||||
|
@ -3,8 +3,7 @@ from thefuck import utils
|
||||
|
||||
@utils.git_support
|
||||
def match(command, settings):
|
||||
return ('git' in command.script
|
||||
and 'push' in command.script
|
||||
return ('push' in command.script
|
||||
and 'set-upstream' in command.stderr)
|
||||
|
||||
|
||||
|
@ -3,8 +3,7 @@ from thefuck import utils
|
||||
|
||||
@utils.git_support
|
||||
def match(command, settings):
|
||||
return ('git' in command.script
|
||||
and 'push' in command.script
|
||||
return ('push' in command.script
|
||||
and '! [rejected]' in command.stderr
|
||||
and 'failed to push some refs to' in command.stderr
|
||||
and 'Updates were rejected because the tip of your current branch is behind' in command.stderr)
|
||||
|
@ -4,8 +4,7 @@ from thefuck.shells import and_
|
||||
|
||||
@utils.git_support
|
||||
def match(command, settings):
|
||||
return ('git' in command.script
|
||||
and 'push' in command.script
|
||||
return ('push' in command.script
|
||||
and '! [rejected]' in command.stderr
|
||||
and 'failed to push some refs to' in command.stderr
|
||||
and 'Updates were rejected because the tip of your current branch is behind' in command.stderr)
|
||||
|
@ -5,7 +5,7 @@ from thefuck import shells, utils
|
||||
def match(command, settings):
|
||||
# catches "Please commit or stash them" and "Please, commit your changes or
|
||||
# stash them before you can switch branches."
|
||||
return 'git' in command.script and 'or stash them' in command.stderr
|
||||
return 'or stash them' in command.stderr
|
||||
|
||||
|
||||
@utils.git_support
|
||||
|
Loading…
x
Reference in New Issue
Block a user