From c1dc168f80ab362fb35ebefe67bb361cfc55650a Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Fri, 16 Dec 2022 06:36:15 -0500 Subject: [PATCH] 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) --- common/travis/changed_templates.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/common/travis/changed_templates.sh b/common/travis/changed_templates.sh index 2bed2250ae7..e6a4328e3c4 100755 --- a/common/travis/changed_templates.sh +++ b/common/travis/changed_templates.sh @@ -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 }