- try:
- obj = cls._parse_file_header(f)
- obj._sha = FixedSha(filename_to_hex(filename))
- obj._needs_parsing = True
- obj._needs_serialization = True
- return obj
- except (IndexError, ValueError), e:
- raise ObjectFormatException("invalid object header")