Created a rule for trying to push a new repository with no commits.

This commit is contained in:
Adam Barnes
2017-03-22 10:23:35 +00:00
parent 7d3ddfc8d9
commit b22a3ac891
3 changed files with 46 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
import re
from thefuck.utils import replace_command
fix = 'git commit -m "Initial commit." && {command}'
refspec_does_not_match = re.compile(r'src refspec \w+ does not match any\.')
def match(command):
if refspec_does_not_match.search(command.stderr):
return True
return False
def get_new_command(command):
return fix.format(command=command.script)