diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2010-06-23 15:48:57 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2010-06-23 15:48:57 +0200 |
commit | 1e2265a23ecec4e4d9ad60d788462e7f124f1bb7 (patch) | |
tree | 67c56788c74b87e8720562556168f57b439a6ab1 /lib/git/index/fun.py | |
parent | aea0243840a46021e6f77c759c960a06151d91c9 (diff) | |
download | gitpython-1e2265a23ecec4e4d9ad60d788462e7f124f1bb7.tar.gz |
fixed critical bug in traverse_trees_recursive, implemented IndexFile.new including simple test, it may be simple as the methods it uses are throroughly tested
Diffstat (limited to 'lib/git/index/fun.py')
-rw-r--r-- | lib/git/index/fun.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/git/index/fun.py b/lib/git/index/fun.py index b04d018f..23a6d8f9 100644 --- a/lib/git/index/fun.py +++ b/lib/git/index/fun.py @@ -78,15 +78,16 @@ def write_cache(entries, stream, extension_data=None, ShaStreamCls=IndexFileSHA1 def read_entry(stream): """Return: One entry of the given stream""" beginoffset = stream.tell() - ctime = unpack(">8s", stream.read(8))[0] - mtime = unpack(">8s", stream.read(8))[0] + read = stream.read + ctime = unpack(">8s", read(8))[0] + mtime = unpack(">8s", read(8))[0] (dev, ino, mode, uid, gid, size, sha, flags) = \ - unpack(">LLLLLL20sH", stream.read(20 + 4 * 6 + 2)) + unpack(">LLLLLL20sH", read(20 + 4 * 6 + 2)) path_size = flags & CE_NAMEMASK - path = stream.read(path_size) + path = read(path_size) real_size = ((stream.tell() - beginoffset + 8) & ~7) - data = stream.read((beginoffset + real_size) - stream.tell()) + data = read((beginoffset + real_size) - stream.tell()) return IndexEntry((mode, sha, flags, path, ctime, mtime, dev, ino, uid, gid, size)) def read_header(stream): |