From 69dd8750be1fbf55010a738dc1ced4655e727f23 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Tue, 22 Jun 2010 00:05:37 +0200 Subject: index.write_tree: initial version implemented, although its not yet working correctly, a test to explicitly compare the git version with the python implementation is still missing Tree and Index internally use 20 byte shas, converting them only as needed to reduce memory footprint and processing time objects: started own 'fun' module containing the most important tree functions, more are likely to be added soon --- lib/git/db.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/git/db.py') diff --git a/lib/git/db.py b/lib/git/db.py index f3698b76..b7cf0fc7 100644 --- a/lib/git/db.py +++ b/lib/git/db.py @@ -4,9 +4,12 @@ from gitdb.base import ( OStream ) +from gitdb.util import to_hex_sha + from gitdb.db import GitDB from gitdb.db import LooseObjectDB + __all__ = ('GitCmdObjectDB', 'GitDB' ) #class GitCmdObjectDB(CompoundDB, ObjectDBW): @@ -24,11 +27,11 @@ class GitCmdObjectDB(LooseObjectDB): self._git = git def info(self, sha): - t = self._git.get_object_header(sha) + t = self._git.get_object_header(to_hex_sha(sha)) return OInfo(*t) def stream(self, sha): """For now, all lookup is done by git itself""" - t = self._git.stream_object_data(sha) + t = self._git.stream_object_data(to_hex_sha(sha)) return OStream(*t) -- cgit v1.2.1