#!/bin/bash

# This file was generated by rhpkg when cloning the repository.
# You can edit it to your liking or delete completely. It will not
# be recreated.
# Creating this file can be also prevented by adding an option
# "skip_hooks = True" into the rhpkg's config file; [rhpkg] section.

_remote="$1"
_url="$2"

exit_code=0
while read -r _local_ref local_sha _remote_ref _remote_sha
do
    command -v rhpkg >/dev/null 2>&1 || { echo >&2 "Warning: 'rhpkg' is missing, \
pre-push check is omitted. See .git/hooks/pre-push"; exit 0; }
    rhpkg pre-push-check "$local_sha"
    ret_code=$?
    if [ $ret_code -ne 0 ] && [ $exit_code -eq 0 ]; then
        exit_code=$ret_code
    fi
done

exit $exit_code