def resolve_merge_commit(commit):
    """
  If commit was made by merge-queue, find the real owner and return that
  commit.
  """
    try:
        while commit.author.email.startswith(u'merge'):
            commit = commit.parents[-1]
        return commit
    except:
        return None
