diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2010-07-20 16:18:01 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2010-07-20 16:18:01 +0200 |
commit | 192472f9673b18c91ce618e64e935f91769c50e7 (patch) | |
tree | 11fa568ea41d3856e6df605c8c8c8559fded3745 /lib/git/index/typ.py | |
parent | 89422841e46efa99bda49acfbe33ee1ca5122845 (diff) | |
download | gitpython-192472f9673b18c91ce618e64e935f91769c50e7.tar.gz |
BaseIndexEntry: Added to_blob method, refactored functionality sligthly
repo.clone: assured backslashes won't reach the remote configuration, as it can cause trouble when re-reading the file later on. Some git commands don't appear to be able to properly deal with backslashes, other's do
Diffstat (limited to 'lib/git/index/typ.py')
-rw-r--r-- | lib/git/index/typ.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/git/index/typ.py b/lib/git/index/typ.py index 3a01cd65..ad988285 100644 --- a/lib/git/index/typ.py +++ b/lib/git/index/typ.py @@ -9,6 +9,7 @@ from binascii import ( b2a_hex, ) +from git.objects import Blob __all__ = ('BlobFilter', 'BaseIndexEntry', 'IndexEntry') #{ Invariants @@ -101,6 +102,10 @@ class BaseIndexEntry(tuple): def from_blob(cls, blob, stage = 0): """:return: Fully equipped BaseIndexEntry at the given stage""" return cls((blob.mode, blob.binsha, stage << CE_STAGESHIFT, blob.path)) + + def to_blob(self, repo): + """:return: Blob using the information of this index entry""" + return Blob(repo, self.binsha, self.mode, self.path) class IndexEntry(BaseIndexEntry): |