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-hotfix b/git-flow-hotfix
index ef3fac3..51ca9e1 100644
--- a/git-flow-hotfix
+++ b/git-flow-hotfix
@@ -14,6 +14,7 @@
VERSION_PREFIX=$(git config --get gitflow.prefix.versiontag)
PREFIX=$(git config --get gitflow.prefix.hotfix || echo hotfix/)
+FLAG_FETCH=1
usage() {
echo "usage: git flow hotfix [list]"
@@ -50,6 +51,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"
BASE="${2:-$MASTER_BRANCH}"
if [ "$VERSION" = "" ]; then
@@ -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 $MASTER_BRANCH
+ fi
gitflow_require_branches_equal $MASTER_BRANCH $ORIGIN/$MASTER_BRANCH
gitflow_require_branch_absent $BRANCH
@@ -91,8 +98,10 @@
# sanity checks
gitflow_require_clean_working_tree
- git fetch -q $ORIGIN $MASTER_BRANCH
- git fetch -q $ORIGIN $DEVELOP_BRANCH
+ 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