1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-03-14 14:48:49 +00:00

Merge b4aa9557459a1f547379c78bc83d8447cc5b7787 into 045c8ae76c9a020d3d27ab132cd06fa075b20f7d

This commit is contained in:
David Hart 2018-01-02 22:19:46 +00:00 committed by GitHub
commit 7ba9e9ee8b
2 changed files with 18 additions and 1 deletions

View File

@ -13,6 +13,19 @@ To push the current branch and set the remote as upstream, use
'''
@pytest.fixture
def output_bitbucket():
return '''Total 0 (delta 0), reused 0 (delta 0)
remote:
remote: Create pull request for feature/test:
remote: https://bitbucket.org/test.git
remote:
To git@bitbucket.org:test.git
e5e7fbb..700d998 feature/test -> feature/test
Branch feature/test set up to track remote branch feature/test from origin.
'''
def test_match(output):
assert match(Command('git push', output))
assert match(Command('git push master', output))
@ -20,6 +33,10 @@ def test_match(output):
assert not match(Command('ls', output))
def test_match_bitbucket(output_bitbucket):
assert not match(Command('git push origin', output_bitbucket))
def test_get_new_command(output):
assert get_new_command(Command('git push', output))\
== "git push --set-upstream origin master"

View File

@ -6,7 +6,7 @@ from thefuck.specific.git import git_support
@git_support
def match(command):
return ('push' in command.script
and 'set-upstream' in command.output)
and 'git push --set-upstream' in command.output)
def _get_upstream_option_index(command_parts):