mirror of
https://github.com/nvbn/thefuck.git
synced 2025-03-19 00:58:56 +00:00
Remove redundant check - it's handled in the while-loop
This commit is contained in:
parent
f5e8b89df7
commit
97b8cd09da
@ -32,10 +32,10 @@ def get_new_command(command):
|
|||||||
# In case of `git push -u` we don't have next argument:
|
# In case of `git push -u` we don't have next argument:
|
||||||
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)
|
||||||
elif len(command_parts) > 2:
|
else:
|
||||||
push_idx = command_parts.index('push') + 1
|
|
||||||
# the only non-qualified permitted options are the repository and refspec; git's
|
# 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.
|
# suggestion include them, so they won't be lost, but would be duplicated otherwise.
|
||||||
|
push_idx = command_parts.index('push') + 1
|
||||||
while len(command_parts) > push_idx and command_parts[len(command_parts) - 1][0] != '-':
|
while len(command_parts) > push_idx and command_parts[len(command_parts) - 1][0] != '-':
|
||||||
command_parts.pop(len(command_parts) - 1)
|
command_parts.pop(len(command_parts) - 1)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user