1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-03-25 03:59:08 +00:00
thefuck/thefuck/rules/git_push.py
2016-08-19 22:08:30 +01:00

15 lines
402 B
Python

from thefuck.utils import replace_argument
from thefuck.specific.git import git_support
@git_support
def match(command):
return ('push' in command.script
and 'set-upstream' in command.stderr)
@git_support
def get_new_command(command):
push_upstream = command.stderr.split('\n')[-3].strip().partition('git ')[2]
return replace_argument(command.script, 'push', push_upstream)