def read_cache_entry(f):
 beginoffset = f.tell()
 ctime = read_cache_time(f)
 mtime = read_cache_time(f)
 (dev, ino, mode, uid, gid, size, sha, flags) = struct.unpack('>LLLLLL20sH', f.read(((20 + (4 * 6)) + 2)))
 name = f.read((flags & 4095))
 real_size = (((f.tell() - beginoffset) + 8) & (~ 7))
 f.read(((beginoffset + real_size) - f.tell()))
 return (name, ctime, mtime, dev, ino, mode, uid, gid, size, sha_to_hex(sha), (flags & (~ 4095)))

def read_cache_entry ( f ) : beginoffset = f . tell ( ) ctime = read_cache_time ( f ) mtime = read_cache_time ( f ) ( dev , ino , mode , uid , gid , size , sha , flags ) = struct . unpack ( '>LLLLLL20sH' , f . read ( ( ( 20 + ( 4 * 6 ) ) + 2 ) ) ) name = f . read ( ( flags & 4095 ) ) real_size = ( ( ( f . tell ( ) - beginoffset ) + 8 ) & ( ~ 7 ) ) f . read ( ( ( beginoffset + real_size ) - f . tell ( ) ) ) return ( name , ctime , mtime , dev , ino , mode , uid , gid , size , sha_to_hex ( sha ) , ( flags & ( ~ 4095 ) ) )
read an entry from a cache file .