Disallow version bump with dirty working tree
This commit is contained in:
parent
c1ba265dd9
commit
853e735edf
|
@ -105,6 +105,17 @@ check)
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
# Version bumps should occur in their own commit. Disallow bumping version
|
||||||
|
# in dirty working trees. Gate after arg parsing to prevent breaking the
|
||||||
|
# `check` subcommand.
|
||||||
|
(
|
||||||
|
set +e
|
||||||
|
if ! git diff --exit-code; then
|
||||||
|
echo -e "\nError: Working tree is dirty. Commit or discard changes before bumping version." 1>&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
)
|
||||||
|
|
||||||
newVersion="$MAJOR.$MINOR.$PATCH$SPECIAL"
|
newVersion="$MAJOR.$MINOR.$PATCH$SPECIAL"
|
||||||
|
|
||||||
# Update all the Cargo.toml files
|
# Update all the Cargo.toml files
|
||||||
|
|
Loading…
Reference in New Issue