def read_pack_header(read):
 header = read(12)
 if (not header):
  return (None, None)
 if (header[:4] != 'PACK'):
  raise AssertionError(('Invalid pack header %r' % header))
 (version,) = unpack_from('>L', header, 4)
 if (version not in (2, 3)):
  raise AssertionError(('Version was %d' % version))
 (num_objects,) = unpack_from('>L', header, 8)
 return (version, num_objects)

def read_pack_header ( read ) : header = read ( 12 ) if ( not header ) : return ( None , None ) if ( header [ : 4 ] != 'PACK' ) : raise AssertionError ( ( 'Invalid pack header %r' % header ) ) ( version , ) = unpack_from ( '>L' , header , 4 ) if ( version not in ( 2 , 3 ) ) : raise AssertionError ( ( 'Version was %d' % version ) ) ( num_objects , ) = unpack_from ( '>L' , header , 8 ) return ( version , num_objects )
read the header of a pack file .