Skip to content
This repository
Browse code

Added function gitflow_require_initialized(), to assert that the gitflow

variables are all set (they need to be set explicitly once).
  • Loading branch information...
commit c1598bf2cf8e27e556240e728a9d389b4299e67c 1 parent 1d8bb0d
Vincent Driessen authored
3  git-flow-feature
@@ -13,8 +13,9 @@
13 13 #
14 14
15 15 gitflow_require_git_repo
  16 +gitflow_require_initialized
16 17 gitflow_load_settings
17   -PREFIX=$(git config --get gitflow.prefix.feature || echo feature/)
  18 +PREFIX=$(git config --get gitflow.prefix.feature)
18 19
19 20 usage() {
20 21 echo "usage: git flow feature [list] [-v]"
3  git-flow-hotfix
@@ -13,9 +13,10 @@
13 13 #
14 14
15 15 gitflow_require_git_repo
  16 +gitflow_require_initialized
16 17 gitflow_load_settings
17 18 VERSION_PREFIX=$(git config --get gitflow.prefix.versiontag)
18   -PREFIX=$(git config --get gitflow.prefix.hotfix || echo hotfix/)
  19 +PREFIX=$(git config --get gitflow.prefix.hotfix)
19 20
20 21 usage() {
21 22 echo "usage: git flow hotfix [list] [-v]"
3  git-flow-release
@@ -13,9 +13,10 @@
13 13 #
14 14
15 15 gitflow_require_git_repo
  16 +gitflow_require_initialized
16 17 gitflow_load_settings
17 18 VERSION_PREFIX=$(git config --get gitflow.prefix.versiontag)
18   -PREFIX=$(git config --get gitflow.prefix.release || echo release/)
  19 +PREFIX=$(git config --get gitflow.prefix.release)
19 20
20 21 usage() {
21 22 echo "usage: git flow release [list] [-v]"
3  git-flow-support
@@ -13,9 +13,10 @@
13 13 #
14 14
15 15 gitflow_require_git_repo
  16 +gitflow_require_initialized
16 17 gitflow_load_settings
17 18 VERSION_PREFIX=$(git config --get gitflow.prefix.versiontag)
18   -PREFIX=$(git config --get gitflow.prefix.support || echo support/)
  19 +PREFIX=$(git config --get gitflow.prefix.support)
19 20
20 21 warn "note: The support subcommand is still very EXPERIMENTAL!"
21 22 warn "note: DO NOT use it in a production situation."
12 gitflow-common
@@ -74,8 +74,8 @@ gitflow_all_tags() { git tag; }
74 74 # loading settings that can be overridden using git config
75 75 gitflow_load_settings() {
76 76 export DOT_GIT_DIR=$(git rev-parse --git-dir >/dev/null 2>&1)
77   - export MASTER_BRANCH=$(git config --get gitflow.branch.master || echo master)
78   - export DEVELOP_BRANCH=$(git config --get gitflow.branch.develop || echo develop)
  77 + export MASTER_BRANCH=$(git config --get gitflow.branch.master)
  78 + export DEVELOP_BRANCH=$(git config --get gitflow.branch.develop)
79 79 export ORIGIN=$(git config --get gitflow.origin || echo origin)
80 80 }
81 81
@@ -144,7 +144,13 @@ gitflow_test_clean_working_tree() {
144 144
145 145 gitflow_require_git_repo() {
146 146 if ! git rev-parse --git-dir >/dev/null 2>&1; then
147   - die "Not a git repository"
  147 + die "fatal: Not a git repository"
  148 + fi
  149 +}
  150 +
  151 +gitflow_require_initialized() {
  152 + if ! gitflow_is_initialized; then
  153 + die "fatal: Not a gitflow-enabled repo yet. Please run \"git flow init\" first."
148 154 fi
149 155 }
150 156

0 comments on commit c1598bf

Please sign in to comment.
Something went wrong with that request. Please try again.