Permalink
Browse files

Merge pull request #11 from bronson/master

Ensure all changes are committed and pushed before deploying
  • Loading branch information...
2 parents 128a6cf + b977ad2 commit 009572f6b55d2ad2fca4120b2ac7e4d5b329140b @tj tj committed May 7, 2012
Showing with 11 additions and 0 deletions.
  1. +11 −0 bin/deploy
View
11 bin/deploy
@@ -305,6 +305,16 @@ require_env() {
}
#
+# Ensure all changes are committed and pushed before deploying.
+#
+
+check_for_local_changes() {
+ git --no-pager diff --exit-code --quiet || abort "commit or stash your changes before deploying"
+ git --no-pager diff --exit-code --quiet --cached || abort "commit your staged changes before deploying"
+ [ -z "`git rev-list @{upstream}.. -n 1`" ] || abort "push your changes before deploying"
+}
+
+#
# Update deploy.
#
@@ -350,6 +360,7 @@ while test $# -ne 0; do
done
require_env
+check_for_local_changes
# deploy
deploy "${REF:-`config_get ref`}"

0 comments on commit 009572f

Please sign in to comment.