def pair_files(a_files, b_files):
    """Paths must be relative to the diff root for each side."""
    pairs = []
    for f in a_files[:]:
        if f in b_files:
            i = a_files.index(f)
            j = b_files.index(f)
            pairs.append((f, f))
            del a_files[i]
            del b_files[j]
        else:
            pairs.append((f, ''))
    for f in b_files:
        pairs.append(('', f))
    return pairs
