def METHOD_NAME(testrepo, tmp_path, pack_delegate):
    # Helper method to confirm the contents of two repos before and after packing
    pack_repo = setup_second_repo(tmp_path)
    pack_repo_path = Path(pack_repo.path)
    objects_dir = pack_repo_path / 'objects'
    utils.rmtree(objects_dir)
    pack_path = objects_dir / 'pack'
    pack_path.mkdir(parents=True)
    # assert that the number of written objects is the same as the number of objects in the repo
    written_objects = testrepo.pack(pack_path, pack_delegate=pack_delegate)
    assert written_objects == len([obj for obj in testrepo])
    # assert that the number of objects in the pack repo is the same as the original repo
    orig_objects = [obj for obj in testrepo.odb]
    packed_objects = [obj for obj in pack_repo.odb]
    assert len(packed_objects) == len(orig_objects)
    # assert that the objects in the packed repo are the same objects as the original repo
    for i, obj in enumerate(orig_objects):
        assert pack_repo[obj].type == testrepo[obj].type
        assert pack_repo[obj].read_raw() == testrepo[obj].read_raw()