mirror of
https://github.com/nvbn/thefuck.git
synced 2025-01-31 02:01:13 +00:00
#369 Fix git_fix_stash
fails when script is just git
This commit is contained in:
parent
71dc2666cc
commit
213791d3c2
@ -23,6 +23,10 @@ def test_match(wrong):
|
|||||||
assert match(Command(wrong, stderr=git_stash_err))
|
assert match(Command(wrong, stderr=git_stash_err))
|
||||||
|
|
||||||
|
|
||||||
|
def test_not_match():
|
||||||
|
assert not match(Command("git", stderr=git_stash_err))
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize('wrong,fixed', [
|
@pytest.mark.parametrize('wrong,fixed', [
|
||||||
('git stash opp', 'git stash pop'),
|
('git stash opp', 'git stash pop'),
|
||||||
('git stash Some message', 'git stash save Some message'),
|
('git stash Some message', 'git stash save Some message'),
|
||||||
|
@ -5,8 +5,12 @@ from thefuck.specific.git import git_support
|
|||||||
|
|
||||||
@git_support
|
@git_support
|
||||||
def match(command):
|
def match(command):
|
||||||
return (command.script.split()[1] == 'stash'
|
splited_script = command.script.split()
|
||||||
and 'usage:' in command.stderr)
|
if len(splited_script) > 1:
|
||||||
|
return (splited_script[1] == 'stash'
|
||||||
|
and 'usage:' in command.stderr)
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
|
||||||
# git's output here is too complicated to be parsed (see the test file)
|
# git's output here is too complicated to be parsed (see the test file)
|
||||||
stash_commands = (
|
stash_commands = (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user