1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-11-17 23:36:02 +00:00
Files
thefuck/thefuck/rules/git_stash.py
2016-01-29 13:09:40 +03:00

16 lines
421 B
Python

from thefuck.shells import shell
from thefuck.specific.git import git_support
@git_support
def match(command):
# catches "Please commit or stash them" and "Please, commit your changes or
# stash them before you can switch branches."
return 'or stash them' in command.stderr
@git_support
def get_new_command(command):
formatme = shell.and_('git stash', '{}')
return formatme.format(command.script)