#!/bin/bash

if [ -z "$VALIDATE_UPSTREAM" ]; then
	# this is kind of an expensive check, so let's not do this twice if we
	# are running more than one validate bundlescript
	
	VALIDATE_REPO='https://github.com/containers/skopeo.git'
	VALIDATE_BRANCH='main'

	git fetch -q "$VALIDATE_REPO" "refs/heads/$VALIDATE_BRANCH"
	VALIDATE_UPSTREAM="$(git rev-parse --verify FETCH_HEAD)"

	validate_diff() {
		git diff "$VALIDATE_UPSTREAM" "$@"
	}
fi
