Suggest git checkout -b (#754)
This fixes https://github.com/nvbn/thefuck/issues/632 This uses `script_parts` instead of `script.startswith` to let it work even if there's extra spaces in the command, e.g. git checkout unknown
This commit is contained in:
committed by
Joseph Frazier
parent
9e788196e6
commit
83cf97dc26
@@ -34,6 +34,8 @@ def get_new_command(command):
|
||||
fallback_to_first=False)
|
||||
if closest_branch:
|
||||
return replace_argument(command.script, missing_file, closest_branch)
|
||||
elif command.script_parts[1] == 'checkout':
|
||||
return replace_argument(command.script, 'checkout', 'checkout -b')
|
||||
else:
|
||||
return shell.and_('git branch {}', '{}').format(
|
||||
missing_file, command.script)
|
||||
|
||||
Reference in New Issue
Block a user