def METHOD_NAME(push_results):
    if not push_results:
        raise PushError("GitPython failed to push but did not report any cause!")
    failures = []
    # XXX The only accepted flags are: PushInfo.FAST_FORWARD and PushInfo.UP_TO_DATE.
    # We may eventually want to add NEW_TAG the day treescript supports git tags.
    for flag_name, flag in (
        ("NEW_TAG", PushInfo.NEW_TAG),
        ("NEW_HEAD", PushInfo.NEW_HEAD),
        ("NO_MATCH", PushInfo.NO_MATCH),
        ("REJECTED", PushInfo.REJECTED),
        ("REMOTE_REJECTED", PushInfo.REMOTE_REJECTED),
        ("REMOTE_FAILURE", PushInfo.REMOTE_FAILURE),
        ("DELETED", PushInfo.DELETED),
        ("FORCED_UPDATE", PushInfo.FORCED_UPDATE),
        ("ERROR", PushInfo.ERROR),
    ):
        failures.extend([(result, flag_name) for result in push_results if result.flags & flag])
    if failures:
        raise PushError(
            "Some of the pushes had unexpected results: {}".format(
                ['Push "{}" reported "{}". '.format(result.summary, flag_name) for result, flag_name in failures]
            )
        )