diff options
author | Kai Lautaportti <kai.lautaportti@hexagonit.fi> | 2008-09-12 22:45:43 +0300 |
---|---|---|
committer | Kai Lautaportti <kai.lautaportti@hexagonit.fi> | 2008-09-12 22:45:43 +0300 |
commit | fa8fe4cad336a7bdd8fb315b1ce445669138830c (patch) | |
tree | 316d7948f2a3a62d7c39fb2c646b332e4ba359d8 /test/git/test_repo.py | |
parent | d7781e1056c672d5212f1aaf4b81ba6f18e8dd8b (diff) | |
download | gitpython-fa8fe4cad336a7bdd8fb315b1ce445669138830c.tar.gz |
Added a read-only Repo.active_branch property which returns the name of the currently active branch.
Diffstat (limited to 'test/git/test_repo.py')
-rw-r--r-- | test/git/test_repo.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test/git/test_repo.py b/test/git/test_repo.py index 4a5ee8ac..13846555 100644 --- a/test/git/test_repo.py +++ b/test/git/test_repo.py @@ -307,10 +307,16 @@ class TestRepo(object): git.return_value = '' assert_false(self.repo.is_dirty) assert_equal(git.call_args, (('diff', 'HEAD'), {})) - + @patch(Git, '_call_process') def test_is_dirty_with_dirty_working_dir(self, git): self.repo.bare = False git.return_value = '''-aaa\n+bbb''' assert_true(self.repo.is_dirty) assert_equal(git.call_args, (('diff', 'HEAD'), {})) + + @patch(Git, '_call_process') + def test_active_branch(self, git): + git.return_value = 'refs/heads/major-refactoring' + assert_equal(self.repo.active_branch, 'major-refactoring') + assert_equal(git.call_args, (('symbolic_ref', 'HEAD'), {})) |