summaryrefslogtreecommitdiff
path: root/test/git/test_commit.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2010-06-04 17:22:08 +0200
committerSebastian Thiel <byronimo@gmail.com>2010-06-04 17:22:08 +0200
commite746f96bcc29238b79118123028ca170adc4ff0f (patch)
treeefa61d7735d41c4fa42ddec952886332654d3b63 /test/git/test_commit.py
parenta1e80445ad5cb6da4c0070d7cb8af89da3b0803b (diff)
downloadgitpython-e746f96bcc29238b79118123028ca170adc4ff0f.tar.gz
Fixed implementation after design change to deal with it - all tests run, but next there will have to be more through testing
Diffstat (limited to 'test/git/test_commit.py')
-rw-r--r--test/git/test_commit.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/test/git/test_commit.py b/test/git/test_commit.py
index e914b9a7..e65e2e59 100644
--- a/test/git/test_commit.py
+++ b/test/git/test_commit.py
@@ -6,6 +6,7 @@
from test.testlib import *
from git import *
+from git.odb import IStream
from cStringIO import StringIO
import time
@@ -31,8 +32,8 @@ def assert_commit_serialization(rwrepo, commit_id, print_performance_info=False)
streamlen = stream.tell()
stream.seek(0)
- csha = rwrepo.odb.store(Commit.type, streamlen, stream)
- assert csha == cm.sha
+ istream = rwrepo.odb.store(IStream(Commit.type, streamlen, stream))
+ assert istream.sha == cm.sha
nc = Commit(rwrepo, Commit.NULL_HEX_SHA, cm.tree.sha,
cm.author, cm.authored_date, cm.author_tz_offset,
@@ -45,7 +46,12 @@ def assert_commit_serialization(rwrepo, commit_id, print_performance_info=False)
ns += 1
streamlen = stream.tell()
stream.seek(0)
- nc.sha = rwrepo.odb.store(Commit.type, streamlen, stream)
+
+ # reuse istream
+ istream.size = streamlen
+ istream.stream = stream
+ istream.sha = None
+ nc.sha = rwrepo.odb.store(istream).sha
# if it worked, we have exactly the same contents !
assert nc.sha == cm.sha