from pathlib import Path


def nest_sha(root: Path, sha: str, nest: int) -> Path:
    """Split a sha for a given nesting level"""
    if nest == 0:
        return root / sha
    return nest_sha(root / sha[:2], sha[2:], nest - 1)