@@ -30,6 +30,7 @@ SCIJAVA_THIRDPARTY_REPOSITORY=$SCIJAVA_BASE_REPOSITORY/thirdparty
30
30
# Parse command line options.
31
31
BATCH_MODE=--batch-mode
32
32
SKIP_VERSION_CHECK=
33
+ SKIP_BRANCH_CHECK=
33
34
SKIP_LICENSE_UPDATE=
34
35
SKIP_PUSH=
35
36
SKIP_GPG=
47
48
--dry-run) DRY_RUN=echo;;
48
49
--no-batch-mode) BATCH_MODE=;;
49
50
--skip-version-check) SKIP_VERSION_CHECK=t;;
51
+ --skip-branch-check) SKIP_BRANCH_CHECK=t;;
50
52
--skip-license-update) SKIP_LICENSE_UPDATE=t;;
51
53
--skip-push) SKIP_PUSH=t;;
52
54
--tag=* )
@@ -92,6 +94,7 @@ Where <version> is the version to release. If omitted, it will prompt you.
92
94
Options include:
93
95
--dry-run - Simulate the release without actually doing it.
94
96
--skip-version-check - Skips the SemVer and parent pom version checks.
97
+ --skip-branch-check - Skips the default branch check.
95
98
--skip-license-update - Skips update of the copyright blurbs.
96
99
--skip-push - Do not push to the remote git repository.
97
100
--dev-version=<x.y.z> - Specify next development version explicitly;
@@ -179,7 +182,11 @@ remote=${upstreamBranch%/*}
179
182
defaultBranch=$( git remote show " $remote " | grep " HEAD branch" | sed ' s/.*: //' )
180
183
181
184
# 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
+ }
183
190
184
191
# If REMOTE is unset, use branch's upstream remote by default.
185
192
REMOTE=" ${REMOTE:- $remote } "
0 commit comments