mirror of
https://github.com/nvbn/thefuck.git
synced 2025-11-19 08:16:06 +00:00
#295 Add git_push_pull rule
This commit is contained in:
17
thefuck/rules/git_push_pull.py
Normal file
17
thefuck/rules/git_push_pull.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from thefuck import utils
|
||||
from thefuck.shells import and_
|
||||
|
||||
|
||||
@utils.git_support
|
||||
def match(command, settings):
|
||||
return ('git' in command.script
|
||||
and '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)
|
||||
|
||||
|
||||
@utils.git_support
|
||||
def get_new_command(command, settings):
|
||||
return and_(command.script.replace('push', 'pull'),
|
||||
command.script)
|
||||
Reference in New Issue
Block a user