Make the 'to fetch or not to fetch' flag explicit in the other commands, too.
Only difference is that the default equals to:
0 for git-flow-feature
1 for git-flow-{release,hotfix,support}
diff --git a/git-flow-release b/git-flow-release
index 7a102d1..c7c9a08 100644
--- a/git-flow-release
+++ b/git-flow-release
@@ -14,6 +14,7 @@
VERSION_PREFIX=$(git config --get gitflow.prefix.versiontag)
PREFIX=$(git config --get gitflow.prefix.release || echo release/)
+FLAG_FETCH=1
usage() {
echo "usage: git flow release [list]"
@@ -51,6 +52,10 @@
}
parse_args() {
+ # TODO: When we have a nice structured way of parsing flags with getopt,
+ # implement the following flags:
+ # --fetch, to set FLAG_FETCH=1
+ # --no-fetch, to set FLAG_FETCH=0
VERSION="$1"
if [ "$VERSION" = "" ]; then
echo "Missing argument <version>."
@@ -65,7 +70,9 @@
# sanity checks
gitflow_require_clean_working_tree
- git fetch -q $ORIGIN
+ if [ $FLAG_FETCH -eq 1 ]; then
+ git fetch -q $ORIGIN $DEVELOP_BRANCH
+ fi
gitflow_require_branches_equal $DEVELOP_BRANCH $ORIGIN/$DEVELOP_BRANCH
gitflow_require_branch_absent $BRANCH
@@ -91,7 +98,10 @@
# sanity checks
gitflow_require_clean_working_tree
- git fetch -q $ORIGIN
+ if [ $FLAG_FETCH -eq 1 ]; then
+ git fetch -q $ORIGIN $MASTER_BRANCH
+ git fetch -q $ORIGIN $DEVELOP_BRANCH
+ fi
gitflow_require_branches_equal $MASTER_BRANCH $ORIGIN/$MASTER_BRANCH
gitflow_require_branches_equal $DEVELOP_BRANCH $ORIGIN/$DEVELOP_BRANCH