From dc902eda3e79ae00a293b9dd2006c019ab252520 Mon Sep 17 00:00:00 2001 From: pccr Date: Sat, 21 Apr 2012 00:23:55 -0400 Subject: [PATCH] Added 'init()' function to git-flow-{feature,release,hotfix,support}, which gets called if subargument is not help --- git-flow | 5 ++++- git-flow-feature | 10 ++++++---- git-flow-hotfix | 12 +++++++----- git-flow-release | 12 +++++++----- git-flow-support | 12 +++++++----- 5 files changed, 31 insertions(+), 20 deletions(-) diff --git a/git-flow b/git-flow index 93e9f0f73..19c337ef7 100755 --- a/git-flow +++ b/git-flow @@ -109,7 +109,10 @@ main() { fi # run the specified action - cmd_$SUBACTION "$@" + if [ $SUBACTION != "help" ]; then + init + fi + cmd_$SUBACTION "$@" } main "$@" diff --git a/git-flow-feature b/git-flow-feature index e97d67825..4f7e83956 100644 --- a/git-flow-feature +++ b/git-flow-feature @@ -36,10 +36,12 @@ # policies, either expressed or implied, of Vincent Driessen. # -require_git_repo -require_gitflow_initialized -gitflow_load_settings -PREFIX=$(git config --get gitflow.prefix.feature) +init() { + require_git_repo + require_gitflow_initialized + gitflow_load_settings + PREFIX=$(git config --get gitflow.prefix.feature) +} usage() { echo "usage: git flow feature [list] [-v]" diff --git a/git-flow-hotfix b/git-flow-hotfix index b355f3019..6e2c6d58f 100644 --- a/git-flow-hotfix +++ b/git-flow-hotfix @@ -36,11 +36,13 @@ # policies, either expressed or implied, of Vincent Driessen. # -require_git_repo -require_gitflow_initialized -gitflow_load_settings -VERSION_PREFIX=$(eval "echo `git config --get gitflow.prefix.versiontag`") -PREFIX=$(git config --get gitflow.prefix.hotfix) +init() { + require_git_repo + require_gitflow_initialized + gitflow_load_settings + VERSION_PREFIX=$(eval "echo `git config --get gitflow.prefix.versiontag`") + PREFIX=$(git config --get gitflow.prefix.hotfix) +} usage() { echo "usage: git flow hotfix [list] [-v]" diff --git a/git-flow-release b/git-flow-release index bb39d5276..62e3015a6 100644 --- a/git-flow-release +++ b/git-flow-release @@ -36,11 +36,13 @@ # policies, either expressed or implied, of Vincent Driessen. # -require_git_repo -require_gitflow_initialized -gitflow_load_settings -VERSION_PREFIX=$(eval "echo `git config --get gitflow.prefix.versiontag`") -PREFIX=$(git config --get gitflow.prefix.release) +init() { + require_git_repo + require_gitflow_initialized + gitflow_load_settings + VERSION_PREFIX=$(eval "echo `git config --get gitflow.prefix.versiontag`") + PREFIX=$(git config --get gitflow.prefix.release) +} usage() { echo "usage: git flow release [list] [-v]" diff --git a/git-flow-support b/git-flow-support index 605694dc9..ba4d92f2f 100644 --- a/git-flow-support +++ b/git-flow-support @@ -36,11 +36,13 @@ # policies, either expressed or implied, of Vincent Driessen. # -require_git_repo -require_gitflow_initialized -gitflow_load_settings -VERSION_PREFIX=$(eval "echo `git config --get gitflow.prefix.versiontag`") -PREFIX=$(git config --get gitflow.prefix.support) +init() { + require_git_repo + require_gitflow_initialized + gitflow_load_settings + VERSION_PREFIX=$(eval "echo `git config --get gitflow.prefix.versiontag`") + PREFIX=$(git config --get gitflow.prefix.support) +} warn "note: The support subcommand is still very EXPERIMENTAL!" warn "note: DO NOT use it in a production situation."