Empty Bitbucket repositories raise "AssertionError: file too short to contain pack"
Sentry Issue: SWH-LOADER-GIT-1G4
AssertionError: file too short to contain pack
(2 additional frame(s) were not displayed)
...
File "swh/loader/git/loader.py", line 395, in get_contents
for raw_obj in self.iter_objects(b"blob"):
File "swh/loader/git/loader.py", line 385, in iter_objects
PackData.from_file(self.pack_buffer, self.pack_size)
File "dulwich/pack.py", line 1186, in from_file
return cls(str(file), file=file, size=size)
File "dulwich/pack.py", line 1171, in __init__
(version, self._num_objects) = read_pack_header(self._file.read)
File "dulwich/pack.py", line 805, in read_pack_header
raise AssertionError("file too short to contain pack")
Loading failure, updating to `failed` status