mirror of
https://github.com/nvbn/thefuck.git
synced 2025-03-25 03:59:08 +00:00
18 lines
487 B
Python
18 lines
487 B
Python
from thefuck.shells import shell
|
|
from thefuck.specific.git import git_support
|
|
|
|
|
|
@git_support
|
|
def match(command):
|
|
return ('pull' in command.script
|
|
and 'set-upstream' in command.stderr)
|
|
|
|
|
|
@git_support
|
|
def get_new_command(command):
|
|
line = command.stderr.split('\n')[-3].strip()
|
|
branch = line.split(' ')[-1]
|
|
set_upstream = line.replace('<remote>', 'origin')\
|
|
.replace('<branch>', branch)
|
|
return shell.and_(set_upstream, command.script)
|