Allow for setting back a prefix to '' (empty string) by entering '-'
(dash), since the empty string '' means "take the default suggestion"
already. Only needed in rare cases.
diff --git a/git-flow-init b/git-flow-init
index 71d577d..9dce1df 100644
--- a/git-flow-init
+++ b/git-flow-init
@@ -187,35 +187,35 @@
default_suggestion=$(git config --get gitflow.prefix.feature || echo feature/)
echo "Feature branches? [$default_suggestion] \c"
read answer
- prefix=${answer:-$default_suggestion}
+ [ "$answer" = "-" ] && prefix= || prefix=${answer:-$default_suggestion}
git config gitflow.prefix.feature "$prefix"
# Release branches
default_suggestion=$(git config --get gitflow.prefix.release || echo release/)
echo "Release branches? [$default_suggestion] \c"
read answer
- prefix=${answer:-$default_suggestion}
+ [ "$answer" = "-" ] && prefix= || prefix=${answer:-$default_suggestion}
git config gitflow.prefix.release "$prefix"
# Hotfix branches
default_suggestion=$(git config --get gitflow.prefix.hotfix || echo hotfix/)
echo "Hotfix branches? [$default_suggestion] \c"
read answer
- prefix=${answer:-$default_suggestion}
+ [ "$answer" = "-" ] && prefix= || prefix=${answer:-$default_suggestion}
git config gitflow.prefix.hotfix "$prefix"
# Support branches
default_suggestion=$(git config --get gitflow.prefix.support || echo support/)
echo "Support branches? [$default_suggestion] \c"
read answer
- prefix=${answer:-$default_suggestion}
+ [ "$answer" = "-" ] && prefix= || prefix=${answer:-$default_suggestion}
git config gitflow.prefix.support "$prefix"
# Version tag prefix
default_suggestion=$(git config --get gitflow.prefix.versiontag || echo "")
echo "Version tag prefix? [$default_suggestion] \c"
read answer
- prefix=${answer:-$default_suggestion}
+ [ "$answer" = "-" ] && prefix= || prefix=${answer:-$default_suggestion}
git config gitflow.prefix.versiontag "$prefix"
# TODO: what to do with origin?