mirror of
https://github.com/nvbn/thefuck.git
synced 2025-02-23 05:18:38 +00:00
#682: Fix git_push
rule in instant mode
This commit is contained in:
parent
e707728fd5
commit
5504b905f3
@ -1,3 +1,4 @@
|
|||||||
|
import re
|
||||||
from thefuck.utils import replace_argument
|
from thefuck.utils import replace_argument
|
||||||
from thefuck.specific.git import git_support
|
from thefuck.specific.git import git_support
|
||||||
|
|
||||||
@ -32,5 +33,6 @@ def get_new_command(command):
|
|||||||
if len(command_parts) > upstream_option_index:
|
if len(command_parts) > upstream_option_index:
|
||||||
command_parts.pop(upstream_option_index)
|
command_parts.pop(upstream_option_index)
|
||||||
|
|
||||||
push_upstream = command.stderr.split('\n')[-3].strip().partition('git ')[2]
|
arguments = re.findall(r'git push (.*)', command.stderr)[0].strip()
|
||||||
return replace_argument(" ".join(command_parts), 'push', push_upstream)
|
return replace_argument(" ".join(command_parts), 'push',
|
||||||
|
'push {}'.format(arguments))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user