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-release b/git-flow-release
index bff9561..b998673 100644
--- a/git-flow-release
+++ b/git-flow-release
@@ -148,7 +148,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:-$DEVELOP_BRANCH}
require_version_arg
@@ -162,7 +162,9 @@
if flag fetch; then
git fetch -q "$ORIGIN" "$DEVELOP_BRANCH"
fi
- require_branches_equal "$DEVELOP_BRANCH" "$ORIGIN/$DEVELOP_BRANCH"
+ if has "$ORIGIN/$DEVELOP_BRANCH" "$(git_remote_branches)"; then
+ require_branches_equal "$DEVELOP_BRANCH" "$ORIGIN/$DEVELOP_BRANCH"
+ fi
# create branch
git checkout -b "$BRANCH" "$BASE"
@@ -182,7 +184,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
@@ -205,8 +207,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,