def METHOD_NAME(cls, path, repo_root):
    """Create a matcher with parents linked up to the provided `repo_root`"""
    # Create all the intermediate instances between the `repo_root` and the `path`
    # and link them together.
    parents = list(reversed(path.relative_to(repo_root).parents))
    instance = cls(repo_root)
    for parent in parents[1:]:
        instance = instance.for_path(repo_root / parent)
    return instance.for_path(path)