def METHOD_NAME(
    runs: List[Run], git_info: GitInfo, target_url: str
) -> Optional[CheckResult]:
    non_root_run = next((run for run in runs if run.root_id != run.id), None)
    if non_root_run is not None:
        return CheckResult(
            state=State.error.value,
            description=f"Run {non_root_run.id} is not the root run of a pipeline.",
            target_url=target_url,
        )
    resolution_ids = [run.id for run in runs]
    with db().get_session() as session:
        resolutions = (
            session.query(Resolution)
            .filter(
                Resolution.root_id.in_(resolution_ids),
            )
            .all()
        )
    error_message = None
    for resolution in resolutions:
        if resolution.git_info is None:
            error_message = f"Run {resolution.root_id} doesn't have Git info."
            break
        run_git_info: GitInfo = resolution.git_info
        if run_git_info.commit != git_info.commit:
            error_message = (
                f"Run {resolution.root_id} isn't "
                f"using code for commit {git_info.commit}"
            )
            break
        if run_git_info.dirty:
            error_message = (
                f"Run {resolution.root_id} was generated "
                f"from code with uncommitted changes"
            )
            break
    if error_message is None:
        return None
    return CheckResult(
        state=State.error.value,
        description=error_message,
        target_url=target_url,
    )