#N/A: Add new git_branch_delete_checked_out rule (#985)
This commit is contained in:
committed by
Vladimir Iakovlev
parent
0ccb34bde8
commit
80cfd6991d
@@ -0,0 +1,19 @@
|
||||
from thefuck.shells import shell
|
||||
from thefuck.specific.git import git_support
|
||||
from thefuck.utils import replace_argument
|
||||
|
||||
|
||||
@git_support
|
||||
def match(command):
|
||||
return (
|
||||
("branch -d" in command.script or "branch -D" in command.script)
|
||||
and "error: Cannot delete branch '" in command.output
|
||||
and "' checked out at '" in command.output
|
||||
)
|
||||
|
||||
|
||||
@git_support
|
||||
def get_new_command(command):
|
||||
return shell.and_("git checkout master", "{}").format(
|
||||
replace_argument(command.script, "-d", "-D")
|
||||
)
|
||||
Reference in New Issue
Block a user