Don't store remote and local branch names in shell variables, but query
them live using git commands instead. This avoids git commands being
issued by subcommands that do not necessarily require an existing Git repo
to be initialized (i.e. git-flow init).
diff --git a/git-flow-release b/git-flow-release
index 602412e..e936de2 100644
--- a/git-flow-release
+++ b/git-flow-release
@@ -43,7 +43,7 @@
local release_branches
local current_branch
local short_names
- release_branches=$(echo "$LOCAL_BRANCHES" | grep "^$PREFIX")
+ release_branches=$(echo "$(gitflow_local_branches)" | grep "^$PREFIX")
if [ -z "$release_branches" ]; then
warn "No release branches exist."
exit 0
@@ -119,7 +119,7 @@
}
require_no_existing_release_branches() {
- local release_branches=$(echo "$LOCAL_BRANCHES" | grep "^$PREFIX")
+ local release_branches=$(echo "$(gitflow_local_branches)" | grep "^$PREFIX")
local first_branch=$(echo ${release_branches} | head -n1)
first_branch=${first_branch#$PREFIX}
[ -z "$release_branches" ] || \