Commit 85258c61 authored by Michal Čihař's avatar Michal Čihař

Implement status

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 3e5ba447
......@@ -65,3 +65,10 @@ class VCSGitTest(RepoTestCase):
def test_rebase(self):
repo = GitRepository.clone(self.repo_path, self._tempdir)
repo.rebase('master')
def test_status(self):
repo = GitRepository.clone(self.repo_path, self._tempdir)
status = repo.status()
self.assertTrue(
"Your branch is up-to-date with 'origin/master'." in status
)
......@@ -41,6 +41,7 @@ class Repository(object):
_cmd_clone = 'clone'
_cmd_update_remote = None
_cmd_push = None
_cmd_status = ['status']
def __init__(self, path):
self.path = path
......@@ -96,6 +97,12 @@ class Repository(object):
"""
self._execute(self._cmd_update_remote)
def status(self):
"""
Returns status of the repository.
"""
return self._execute(self._cmd_status)
def push(self, branch):
"""
Pushes given branch to remote repository.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment