def strip_ref_to_name(ref: str) -> str:
    """Strip a full ref to a name."""
    strips = ("refs/heads/", "refs/tags/")
    for strip in strips:
        if ref.startswith(strip):
            return ref[len(strip) :]
    return ref