Merge pull request #295 from mcarton/new-git-rules

New git rules
This commit is contained in:
Vladimir Iakovlev
2015-07-20 20:42:02 +03:00
5 changed files with 104 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
import re
from thefuck import utils, shells
@utils.git_support
def match(command, settings):
return ('git pull' in command.script
and 'fatal: Not a git repository' in command.stderr
and "Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set)." in command.stderr)
@utils.git_support
def get_new_command(command, settings):
return command.script.replace(' pull ', ' clone ')
+15
View File
@@ -0,0 +1,15 @@
from thefuck import utils
@utils.git_support
def match(command, settings):
return ('git' in command.script
and 'push' in command.script
and '! [rejected]' in command.stderr
and 'failed to push some refs to' in command.stderr
and 'Updates were rejected because the tip of your current branch is behind' in command.stderr)
@utils.git_support
def get_new_command(command, settings):
return command.script.replace('push', 'push --force')