1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-04-15 23:30:44 +01:00
thefuck/thefuck/rules/git_push_without_commits.py
2017-03-22 10:29:50 +00:00

16 lines
333 B
Python

import re
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)