From 84789930957602cb31a318e6c1e28cf9a8babcef Mon Sep 17 00:00:00 2001 From: Sam Seay Date: Mon, 19 Sep 2022 12:58:52 +1200 Subject: [PATCH] Do a checkout of compared branches to ensure prepush checks work (#34706) --- bin/pre-push.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/pre-push.sh b/bin/pre-push.sh index 0bd204d5383..024e1f21b3a 100755 --- a/bin/pre-push.sh +++ b/bin/pre-push.sh @@ -31,4 +31,8 @@ if [ $? -ne 0 ]; then exit 1 fi +# Ensure both branches are tracked or check-changelogger-use will fail. +git checkout $PROTECTED_BRANCH --quiet +git checkout $CURRENT_BRANCH --quiet + php tools/monorepo/check-changelogger-use.php $PROTECTED_BRANCH $CURRENT_BRANCH