Skip to content

Commit d256263

Browse files
committed
release-version.sh: continue in case of no changes
Particularly when running outside batch mode, we might reset to the same SNAPHOT version afterwards, so there may actually be no changes to master at all. In that case, don't try to commit, because otherwise the 'git commit' command will return a non-zero error code, terminating the script early.
1 parent a99b8ce commit d256263

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

release-version.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ mvn $BATCH_MODE release:prepare -DpushChanges=false -Dresume=false \
6464

6565
# Squash the two commits on the current branch into one
6666
git reset --soft HEAD^^ &&
67-
git commit -s -m "Bump to next development cycle" &&
67+
if ! git diff-index --cached --quiet --ignore-submodules HEAD --
68+
then
69+
git commit -s -m "Bump to next development cycle"
70+
fi &&
6871

6972
# push the current branch and the tag
7073
tag=$(sed -n 's/^scm.tag=//p' < release.properties) &&

0 commit comments

Comments
 (0)