1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-03-28 13:38:38 +00:00
thefuck/thefuck/rules/git_push_without_commits.py
Pablo Santiago Blum de Aguiar dbc435c040 #618: Fix git_push_without_commits rule
The rule was in a non-working state. And the tests needed some bit of
simplification. Certain degree of repetition is oftentimes a good thing.
2021-07-29 22:11:34 +02:00

13 lines
309 B
Python

import re
from thefuck.shells import shell
from thefuck.specific.git import git_support
@git_support
def match(command):
return bool(re.search(r"src refspec \w+ does not match any", command.output))
def get_new_command(command):
return shell.and_('git commit -m "Initial commit"', command.script)