Implemented the gitflow_check_clean_working_tree() check for dirty directories.
diff --git a/gitflow-sh-setup b/gitflow-sh-setup
index e1d5329..3181c3f 100755
--- a/gitflow-sh-setup
+++ b/gitflow-sh-setup
@@ -24,8 +24,9 @@
die() { warn "$@"; exit 1; }
gitflow_check_clean_working_tree() {
- # TODO: Implement this
- echo "TODO"
+ if [ "$(git status 2> /dev/null | tail -n1)" != "nothing to commit (working directory clean)" ]; then
+ die "Working directory is dirty. Only use gitflow in clean working directories for your own safety."
+ fi
}
gitflow_require_local_branch() {