Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions tests/test_pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -1299,18 +1299,20 @@ def test_ext_ref_deltified_object_based_on_itself(self):
fsize = f.tell()
f.seek(0)
packdata = PackData.from_file(f, fsize)
packdata.create_index(
"test.idx",
version=2,
resolve_ext_ref=self.get_raw_no_repeat,
)
packindex = load_pack_index("test.idx")
pack = Pack.from_objects(packdata, packindex)
try:
# Attempting to open this REF_DELTA object would loop forever
pack[b1.id]
except UnresolvedDeltas as e:
self.assertEqual((b1.id), e.shas)
with tempfile.TemporaryDirectory() as tempdir:
path = os.path.join(tempdir, "test.idx")
packdata.create_index(
path,
version=2,
resolve_ext_ref=self.get_raw_no_repeat,
)
packindex = load_pack_index(path)
pack = Pack.from_objects(packdata, packindex)
try:
# Attempting to open this REF_DELTA object would loop forever
pack[b1.id]
except UnresolvedDeltas as e:
self.assertEqual((b1.id), e.shas)


class DeltaEncodeSizeTests(TestCase):
Expand Down