def sanitize(rev, sep='\t'):
    """Converts a for-each-ref line to a name/value pair.
    """

    splitrev = rev.split(sep)
    branchval = splitrev[0]
    branchname = splitrev[1].strip()
    if branchname.startswith("refs/heads/"):
        branchname = branchname[11:]

    return branchname, branchval