From 47e3138ee978ce708a41f38a0d874376d7ae5c78 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Fri, 25 Jun 2010 23:58:24 +0200 Subject: Adjusted all files to (hopefully) deal with the fact that all objects now use 20 byte sha's internally as it is closer to the GitDB implementation Switched all remaining files back to tabs Adjusted all remaining docstrings to suit the sphinx doc convention - its likely that there are many of docstring syntax errors though --- lib/git/index/typ.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/git/index/typ.py') diff --git a/lib/git/index/typ.py b/lib/git/index/typ.py index d9cafa2e..7654b402 100644 --- a/lib/git/index/typ.py +++ b/lib/git/index/typ.py @@ -7,7 +7,6 @@ from util import ( from binascii import ( b2a_hex, - a2b_hex ) __all__ = ('BlobFilter', 'BaseIndexEntry', 'IndexEntry') @@ -101,7 +100,7 @@ class BaseIndexEntry(tuple): @classmethod def from_blob(cls, blob, stage = 0): """:return: Fully equipped BaseIndexEntry at the given stage""" - return cls((blob.mode, a2b_hex(blob.sha), stage << CE_STAGESHIFT, blob.path)) + return cls((blob.mode, blob.binsha, stage << CE_STAGESHIFT, blob.path)) class IndexEntry(BaseIndexEntry): @@ -164,6 +163,6 @@ class IndexEntry(BaseIndexEntry): def from_blob(cls, blob, stage = 0): """:return: Minimal entry resembling the given blob object""" time = pack(">LL", 0, 0) - return IndexEntry((blob.mode, a2b_hex(blob.sha), stage << CE_STAGESHIFT, blob.path, time, time, 0, 0, 0, 0, blob.size)) + return IndexEntry((blob.mode, blob.binsha, stage << CE_STAGESHIFT, blob.path, time, time, 0, 0, 0, 0, blob.size)) -- cgit v1.2.1