1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-01-19 04:21:14 +00:00

Merge pull request #236 from bugaevc/git-branch-list

Git branch list
This commit is contained in:
Vladimir Iakovlev 2015-06-02 06:08:09 +03:00
commit 707743e7a7
2 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,18 @@
from thefuck import shells
from thefuck.rules.git_branch_list import match, get_new_command
from tests.utils import Command
def test_match():
assert match(Command('git branch list'), None)
def test_not_match():
assert not match(Command(), None)
assert not match(Command('git commit'), None)
assert not match(Command('git branch'), None)
assert not match(Command('git stash list'), None)
def test_get_new_command():
assert (get_new_command(Command('git branch list'), None) ==
shells.and_('git branch --delete list', 'git branch'))

View File

@ -0,0 +1,10 @@
from thefuck import shells
def match(command, settings):
# catches "git branch list" in place of "git branch"
return command.script.split() == 'git branch list'.split()
def get_new_command(command, settings):
return shells.and_('git branch --delete list', 'git branch')