INNER CODE UNIT · Python
check_object_store_integrity
wolfSSL/wolfssl · scripts/bomsh_verify.py:134
def check_object_store_integrity(omnibor_objects_dir):
"""(B) Every blob in <omnibor_objects_dir> round-trips through
`gitoid_sha1`. Returns (count_total, [(path, expected, actual), ...]
for blobs whose content does not match their expected gitoid).
The directory layout is `<omnibor_objects_dir>/<aa>/<rest>` (Git's
standard fanout, where <aa> is the first two hex chars of the
digest); files outside that shape are skipped silently (e.g.
`info/` or `pack/` siblings, README files, etc.)."""
bad = []
obj_count = 0
for root, _, files in os.walk(omnibor_objects_dir):
for fname in files:
obj = os.path.join(root, fname)
rel = os.path.relpath(obj, omnibor_objects_dir)
parts = rel.split(os.sep)
if not _looks_like_blob_path(parts):
continue