1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-03-14 14:48:49 +00:00

Start after 'git push'

This commit is contained in:
David 2017-12-31 16:15:25 +00:00
parent bc8efdb0a0
commit f5e8b89df7

View File

@ -33,9 +33,10 @@ def get_new_command(command):
if len(command_parts) > upstream_option_index:
command_parts.pop(upstream_option_index)
elif len(command_parts) > 2:
# the last permitted options are the repository and refspec; git's suggestion
# include them, so they won't be lost, but would be duplicated otherwise.
while len(command_parts) > 2 and command_parts[len(command_parts) - 1][0] != '-':
push_idx = command_parts.index('push') + 1
# the only non-qualified permitted options are the repository and refspec; git's
# suggestion include them, so they won't be lost, but would be duplicated otherwise.
while len(command_parts) > push_idx and command_parts[len(command_parts) - 1][0] != '-':
command_parts.pop(len(command_parts) - 1)
arguments = re.findall(r'git push (.*)', command.output)[0].strip()