diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2010-11-24 12:30:51 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2010-11-24 12:30:51 +0100 |
commit | a17c43d0662bab137903075f2cff34bcabc7e1d1 (patch) | |
tree | f757e77c85213da7c53d129476430745465935b0 /test/test_refs.py | |
parent | 8dd51f1d63fa5ee704c2bdf4cb607bb6a71817d2 (diff) | |
download | gitpython-a17c43d0662bab137903075f2cff34bcabc7e1d1.tar.gz |
Made previously protected methods public to introduce a method with reflog support which cannot be exposed using the respective property. Ref-Creation is now fully implemented in python. For details, see doc/source/changes.rst
Diffstat (limited to 'test/test_refs.py')
-rw-r--r-- | test/test_refs.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/test/test_refs.py b/test/test_refs.py index 0c0caaf2..3b7ad9e7 100644 --- a/test/test_refs.py +++ b/test/test_refs.py @@ -205,10 +205,14 @@ class TestRefs(TestBase): for count, new_name in enumerate(("my_new_head", "feature/feature1")): actual_commit = commit+"^"*count new_head = Head.create(rw_repo, new_name, actual_commit) + assert new_head.is_detached assert cur_head.commit == prev_head_commit assert isinstance(new_head, Head) - # already exists - self.failUnlessRaises(GitCommandError, Head.create, rw_repo, new_name) + # already exists, but has the same value, so its fine + Head.create(rw_repo, new_name, new_head.commit) + + # its not fine with a different value + self.failUnlessRaises(OSError, Head.create, rw_repo, new_name, new_head.commit.parents[0]) # force it new_head = Head.create(rw_repo, new_name, actual_commit, force=True) @@ -230,7 +234,7 @@ class TestRefs(TestBase): assert tmp_head not in heads and new_head not in heads # force on deletion testing would be missing here, code looks okay though ;) # END for each new head name - self.failUnlessRaises(TypeError, RemoteReference.create, rw_repo, "some_name") + self.failUnlessRaises(TypeError, RemoteReference.create, rw_repo, "some_name") # tag ref tag_name = "1.0.2" @@ -495,3 +499,10 @@ class TestRefs(TestBase): def test_reflog(self): assert isinstance(self.rorepo.heads.master.log(), RefLog) + + + def test_todo(self): + # delete deletes the reflog + # create creates a new entry + # set_reference and set_commit and set_object use the reflog if message is given + self.fail() |