Change the default behaviour of all scripts to NOT fetch.
This already was the default behaviour of git-flow-feature, but now it
is the default for the other scripts, too.
RATIONALE: Due to limitations on some platforms (and some
implementations of getopt), it's impossible to turn off the -f (fetch)
option. Therefore, it must now be set explicitly.
Also, this makes git-flow work in stand-alone repositories (i.e. repos
that do not have an origin remote at all).
diff --git a/git-flow-hotfix b/git-flow-hotfix
index fe8c804..390e537 100644
--- a/git-flow-hotfix
+++ b/git-flow-hotfix
@@ -153,7 +153,7 @@
}
cmd_start() {
- DEFINE_boolean fetch true "fetch from $ORIGIN before performing finish" F
+ DEFINE_boolean fetch false "fetch from $ORIGIN before performing finish" F
parse_args "$@"
BASE=${2:-$MASTER_BRANCH}
require_version_arg
@@ -167,7 +167,9 @@
if flag fetch; then
git fetch -q "$ORIGIN" "$MASTER_BRANCH"
fi
- require_branches_equal "$MASTER_BRANCH" "$ORIGIN/$MASTER_BRANCH"
+ if has "$ORIGIN/$MASTER_BRANCH" "$(git_remote_branches)"; then
+ require_branches_equal "$MASTER_BRANCH" "$ORIGIN/$MASTER_BRANCH"
+ fi
# create branch
git checkout -b "$BRANCH" "$BASE"
@@ -187,7 +189,7 @@
}
cmd_finish() {
- DEFINE_boolean fetch true "fetch from $ORIGIN before performing finish" F
+ DEFINE_boolean fetch false "fetch from $ORIGIN before performing finish" F
DEFINE_boolean sign false "sign the release tag cryptographically" s
DEFINE_string signingkey "" "use the given GPG-key for the digital signature (implies -s)" u
DEFINE_string message "" "use the given tag message" m
@@ -209,8 +211,12 @@
git fetch -q "$ORIGIN" "$DEVELOP_BRANCH" || \
die "Could not fetch $DEVELOP_BRANCH from $ORIGIN."
fi
- require_branches_equal "$MASTER_BRANCH" "$ORIGIN/$MASTER_BRANCH"
- require_branches_equal "$DEVELOP_BRANCH" "$ORIGIN/$DEVELOP_BRANCH"
+ if has "$ORIGIN/$MASTER_BRANCH" "$(git_remote_branches)"; then
+ require_branches_equal "$MASTER_BRANCH" "$ORIGIN/$MASTER_BRANCH"
+ fi
+ if has "$ORIGIN/$DEVELOP_BRANCH" "$(git_remote_branches)"; then
+ require_branches_equal "$DEVELOP_BRANCH" "$ORIGIN/$DEVELOP_BRANCH"
+ fi
# try to merge into master
# in case a previous attempt to finish this release branch has failed,