From 6144fc86676118bb241ebc35f1f85dd23a726c67 Mon Sep 17 00:00:00 2001 From: ludamad Date: Mon, 31 Jul 2023 13:10:36 -0400 Subject: [PATCH] feat: bb migration iteration --- scripts/migrate_barretenberg_branch.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/migrate_barretenberg_branch.sh b/scripts/migrate_barretenberg_branch.sh index efc58df846f..9f3001c7421 100755 --- a/scripts/migrate_barretenberg_branch.sh +++ b/scripts/migrate_barretenberg_branch.sh @@ -18,6 +18,22 @@ if ! git diff-index --quiet HEAD --; then exit 1 fi +# Check if the current branch is master +current_branch=$(git rev-parse --abbrev-ref HEAD) +if [ "$current_branch" != "master" ]; then + echo "Error: This script must be run from the 'master' branch. Current branch is '$current_branch'" + exit 1 +fi + +# Fetch the latest updates from origin +git fetch origin + +# Check if master is same as origin/master +if ! git diff --quiet master origin/master; then + echo "Error: Local 'master' branch is not up to date with 'origin/master'. Please pull the latest changes." + exit 1 +fi + BRANCH="$1" COMMIT_MESSAGE="$2" SUBREPO_PATH=circuits/cpp/barretenberg # can be changed to another subrepo if useful