common/travis/changed_templates.sh: change branch age check for treeless

small logic change because we now have the complete commit history instead
of just `--depth=200`. This preserves the 200 commit limit with a slightly-
enhanced error message (wording clarified and it now shows up as an error
annotation)
This commit is contained in:
classabbyamp 2022-12-16 06:36:15 -05:00 committed by classabbyamp
parent 7249e827a1
commit c1dc168f80

View File

@ -10,9 +10,10 @@ case "$tip" in
*) tip="${tip%% *}" ;;
esac
base="$(git merge-base FETCH_HEAD "$tip")" || {
echo "Your branches is based on too old copy."
echo "Please rebase to newest copy."
base="$(git merge-base FETCH_HEAD "$tip")"
[ $(git rev-list --count "$tip" "^$base") -lt 200 ] || {
echo "::error title=Branch out of date::Your branch is too out of date. Please rebase on upstream and force-push."
exit 1
}