summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2010-11-23 23:20:11 +0100
committerSebastian Thiel <byronimo@gmail.com>2010-11-23 23:20:11 +0100
commit7029773512eee5a0bb765b82cfdd90fd5ab34e15 (patch)
tree945d209ed7437820ee13e1bb1d617c9ffd922f2f /test
parent61f3db7bd07ac2f3c2ff54615c13bf9219289932 (diff)
downloadgitpython-7029773512eee5a0bb765b82cfdd90fd5ab34e15.tar.gz
Implemented revlog.append_entry as classmethod, to assure we will always actually write_append the new entry, instead of rewriting the whole file. Added file-locking and directory handling, so the implementation should be similar (enough) to the git reference implementation.
Next up is to implement a way to update the reflog when changing references, which is going to be a little more complicated
Diffstat (limited to 'test')
-rw-r--r--test/test_reflog.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/test/test_reflog.py b/test/test_reflog.py
index 67b1a9da..e99e5ba5 100644
--- a/test/test_reflog.py
+++ b/test/test_reflog.py
@@ -72,17 +72,12 @@ class TestRefLog(TestBase):
# ... as well as each bytes of the written stream
assert open(tfile).read() == open(rlp).read()
- # append an entry - it gets written automatically
- entry = treflog.append_entry(IndexObject.NULL_BIN_SHA, binsha, msg)
+ # append an entry
+ entry = RefLog.append_entry(tfile, IndexObject.NULL_BIN_SHA, binsha, msg)
assert entry.oldhexsha == IndexObject.NULL_HEX_SHA
assert entry.newhexsha == 'f'*40
assert entry.message == msg
- assert treflog == RefLog.from_file(tfile)
-
- # but not this time
- treflog.append_entry(binsha, binsha, msg, write=False)
- assert treflog != RefLog.from_file(tfile)
-
+ assert RefLog.from_file(tfile)[-1] == entry
# END for each reflog