#652: Add new git_push_different_branch_names rule
Fix #652 * Basic fix for #652 * Finishing work * Added readme line * Added test * My test was stupid... * Removed redundant lines * That space...
This commit is contained in:
committed by
Pablo Aguiar
parent
2233e3679c
commit
64d6835e15
@@ -0,0 +1,12 @@
|
||||
import re
|
||||
from thefuck.specific.git import git_support
|
||||
|
||||
|
||||
@git_support
|
||||
def match(command):
|
||||
return "push" in command.script and "The upstream branch of your current branch does not match" in command.output
|
||||
|
||||
|
||||
@git_support
|
||||
def get_new_command(command):
|
||||
return re.findall(r'^ +(git push [^\s]+ [^\s]+)', command.output, re.MULTILINE)[0]
|
||||
Reference in New Issue
Block a user