@@ -30,6 +30,7 @@ SCIJAVA_THIRDPARTY_REPOSITORY=$SCIJAVA_BASE_REPOSITORY/thirdparty
3030# Parse command line options.
3131BATCH_MODE=--batch-mode
3232SKIP_VERSION_CHECK=
33+ SKIP_BRANCH_CHECK=
3334SKIP_LICENSE_UPDATE=
3435SKIP_PUSH=
3536SKIP_GPG=
4748 --dry-run) DRY_RUN=echo;;
4849 --no-batch-mode) BATCH_MODE=;;
4950 --skip-version-check) SKIP_VERSION_CHECK=t;;
51+ --skip-branch-check) SKIP_BRANCH_CHECK=t;;
5052 --skip-license-update) SKIP_LICENSE_UPDATE=t;;
5153 --skip-push) SKIP_PUSH=t;;
5254 --tag=* )
@@ -92,6 +94,7 @@ Where <version> is the version to release. If omitted, it will prompt you.
9294Options include:
9395 --dry-run - Simulate the release without actually doing it.
9496 --skip-version-check - Skips the SemVer and parent pom version checks.
97+ --skip-branch-check - Skips the default branch check.
9598 --skip-license-update - Skips update of the copyright blurbs.
9699 --skip-push - Do not push to the remote git repository.
97100 --dev-version=<x.y.z> - Specify next development version explicitly;
@@ -179,7 +182,11 @@ remote=${upstreamBranch%/*}
179182defaultBranch=$( git remote show " $remote " | grep " HEAD branch" | sed ' s/.*: //' )
180183
181184# Check that we are on the main branch.
182- test " $currentBranch " = " $defaultBranch " || die " Non-default branch: $currentBranch "
185+ test " $SKIP_BRANCH_CHECK " || {
186+ test " $currentBranch " = " $defaultBranch " || die " Non-default branch: $currentBranch .
187+ If you are certain you want to release from this branch,
188+ try again with --skip-branch-check flag."
189+ }
183190
184191# If REMOTE is unset, use branch's upstream remote by default.
185192REMOTE=" ${REMOTE:- $remote } "
0 commit comments