mirror of
https://github.com/nvbn/thefuck.git
synced 2025-03-19 00:58:56 +00:00
git_checkout: Use script_parts instead of script.startswith
This lets it work even if there's extra spaces in the command, e.g. git checkout unknown
This commit is contained in:
parent
5bef2c60c5
commit
e2ea2e14fa
@ -34,7 +34,7 @@ def get_new_command(command):
|
|||||||
fallback_to_first=False)
|
fallback_to_first=False)
|
||||||
if closest_branch:
|
if closest_branch:
|
||||||
return replace_argument(command.script, missing_file, closest_branch)
|
return replace_argument(command.script, missing_file, closest_branch)
|
||||||
elif command.script.startswith('git checkout'):
|
elif command.script_parts[1] == 'checkout':
|
||||||
return replace_argument(command.script, 'checkout', 'checkout -b')
|
return replace_argument(command.script, 'checkout', 'checkout -b')
|
||||||
else:
|
else:
|
||||||
return shell.and_('git branch {}', '{}').format(
|
return shell.and_('git branch {}', '{}').format(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user