summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2010-11-24 17:55:43 +0100
committerSebastian Thiel <byronimo@gmail.com>2010-11-24 18:06:00 +0100
commit86523260c495d9a29aa5ab29d50d30a5d1981a0c (patch)
treefd478570d7f8c33b9d1a10c3f108a170edee3841 /test
parentc946bf260d3f7ca54bffb796a82218dce0eb703f (diff)
downloadgitpython-86523260c495d9a29aa5ab29d50d30a5d1981a0c.tar.gz
Renamed msg named parameter to logmsg, as it describes the purpose of the message much better
Added test for deletion of reflog file when the corresponding ref is deleted
Diffstat (limited to 'test')
-rw-r--r--test/test_refs.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/test/test_refs.py b/test/test_refs.py
index 3ad4dad2..52937de1 100644
--- a/test/test_refs.py
+++ b/test/test_refs.py
@@ -102,7 +102,7 @@ class TestRefs(TestBase):
pcommit = cur_head.commit.parents[0].parents[0]
hlog_len = len(head.log())
blog_len = len(cur_head.log())
- head.set_reference(pcommit, 'detached head')
+ assert head.set_reference(pcommit, 'detached head') is head
# one new log-entry
thlog = head.log()
assert len(thlog) == hlog_len + 1
@@ -125,12 +125,12 @@ class TestRefs(TestBase):
# with automatic dereferencing
- head.set_commit(cur_commit, 'change commit once again')
+ assert head.set_commit(cur_commit, 'change commit once again') is head
assert len(head.log()) == hlog_len+4
assert len(cur_head.log()) == blog_len+2
# a new branch has just a single entry
- other_head = Head.create(rwrepo, 'mynewhead', pcommit, msg='new head created')
+ other_head = Head.create(rwrepo, 'mynewhead', pcommit, logmsg='new head created')
log = other_head.log()
assert len(log) == 1
assert log[0].oldhexsha == pcommit.NULL_HEX_SHA
@@ -237,7 +237,11 @@ class TestRefs(TestBase):
tmp_head.rename(new_head, force=True)
assert tmp_head == new_head and tmp_head.object == new_head.object
+ logfile = RefLog.path(tmp_head)
+ assert os.path.isfile(logfile)
Head.delete(rw_repo, tmp_head)
+ # deletion removes the log as well
+ assert not os.path.isfile(logfile)
heads = rw_repo.heads
assert tmp_head not in heads and new_head not in heads
# force on deletion testing would be missing here, code looks okay though ;)
@@ -512,10 +516,3 @@ 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
- # if there is no actual head-change, don't do anything
- self.fail()