#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:
Stef Pletinck
2017-10-15 17:30:29 +02:00
committed by Pablo Aguiar
parent 2233e3679c
commit 64d6835e15
3 changed files with 52 additions and 0 deletions
@@ -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]