Add function gitflow_has_prefixes_configured(), to check whether a repo is
fully initialized for use with gitflow.
Add a means of only asking for the missing gitflow definitions, not all.
(Of course, redefining all is always possible using the -f (--force) flag
of init.)
diff --git a/gitflow-common b/gitflow-common
index 8aaa357..6e5056e 100644
--- a/gitflow-common
+++ b/gitflow-common
@@ -49,12 +49,20 @@
[ "$develop" != "" ] && gitflow_local_branch_exists "$develop"
}
+gitflow_has_prefixes_configured() {
+ git config --get gitflow.prefix.feature >/dev/null 2>&1 && \
+ git config --get gitflow.prefix.release >/dev/null 2>&1 && \
+ git config --get gitflow.prefix.hotfix >/dev/null 2>&1 && \
+ git config --get gitflow.prefix.support >/dev/null 2>&1 && \
+ git config --get gitflow.prefix.versiontag >/dev/null 2>&1
+}
+
gitflow_is_initialized() {
- gitflow_has_master_configured && \
- gitflow_has_develop_configured && \
- # they should be different
- [ "$(git config --get gitflow.branch.master)" != \
- "$(git config --get gitflow.branch.develop)" ]
+ gitflow_has_master_configured && \
+ gitflow_has_develop_configured && \
+ [ "$(git config --get gitflow.branch.master)" != \
+ "$(git config --get gitflow.branch.develop)" ] && \
+ gitflow_has_prefixes_configured
}
# get all available branches