1
0
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:
nvbn
2015-07-20 20:51:18 +03:00
parent b636e9bec7
commit c67560864a
4 changed files with 77 additions and 2 deletions

View 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)