build(release): exit early if changes need pulling
MODIFY
script/release
script/release
@@ -4,6 +4,11 @@ fetch() {
git fetch --all
}
+remote_history_is_clean() {
+ history =$(git rev-list --count --left-only @{u}...HEAD)
+ [ "$history" == "0" ]
+}
+
tag_exists_on_remote() {
git rev-parse --quiet --verify refs/tags/v$1.$2.$3 > /dev/null
}
@@ -85,6 +90,11 @@ main() {
echo "==================="
fetch
+ if ! remote_history_is_clean; then
+ echo "Error: changes exist on origin not pulled into this branch. Please pull"
+ exit 1
+ fi
+
if ! working_tree_is_clean; then
echo "Error: unclean working tree"
exit 1

build(release): exit early if changes need pulling