Skip to content

Commit

Permalink
feat: add check to bb migrate script (#1319)
Browse files Browse the repository at this point in the history
Just an extra check on assumptions.
This may become obsolete for barretenberg once we all move, but also may
become relevant again if we go a Noir subrepo route.
  • Loading branch information
ludamad authored Jul 31, 2023
1 parent 8717827 commit 48c6f34
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions scripts/migrate_barretenberg_branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 48c6f34

Please sign in to comment.