Use git_do where appropriate
diff --git a/git-flow-release b/git-flow-release
index 2d81ed6..cb95bd4 100644
--- a/git-flow-release
+++ b/git-flow-release
@@ -136,7 +136,7 @@
}
require_base_is_on_develop() {
- if ! git branch --no-color --contains "$BASE" 2>/dev/null \
+ if ! git_do branch --no-color --contains "$BASE" 2>/dev/null \
| sed 's/[* ] //g' \
| grep -q "^$DEVELOP_BRANCH\$"; then
die "fatal: Given base '$BASE' is not a valid commit on '$DEVELOP_BRANCH'."
@@ -164,14 +164,14 @@
require_branch_absent "$BRANCH"
require_tag_absent "$VERSION_PREFIX$VERSION"
if flag fetch; then
- git fetch -q "$ORIGIN" "$DEVELOP_BRANCH"
+ git_do fetch -q "$ORIGIN" "$DEVELOP_BRANCH"
fi
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"
+ git_do checkout -b "$BRANCH" "$BASE"
echo
echo "Summary of actions:"
@@ -210,9 +210,9 @@
require_branch "$BRANCH"
require_clean_working_tree
if flag fetch; then
- git fetch -q "$ORIGIN" "$MASTER_BRANCH" || \
+ git_do fetch -q "$ORIGIN" "$MASTER_BRANCH" || \
die "Could not fetch $MASTER_BRANCH from $ORIGIN."
- git fetch -q "$ORIGIN" "$DEVELOP_BRANCH" || \
+ git_do fetch -q "$ORIGIN" "$DEVELOP_BRANCH" || \
die "Could not fetch $DEVELOP_BRANCH from $ORIGIN."
fi
if has "$ORIGIN/$MASTER_BRANCH" $(git_remote_branches); then
@@ -226,16 +226,16 @@
# in case a previous attempt to finish this release branch has failed,
# but the merge into master was successful, we skip it now
if ! git_is_branch_merged_into "$BRANCH" "$MASTER_BRANCH"; then
- git checkout "$MASTER_BRANCH" || \
+ git_do checkout "$MASTER_BRANCH" || \
die "Could not check out $MASTER_BRANCH."
if noflag squash; then
- git merge --no-ff "$BRANCH" || \
+ git_do merge --no-ff "$BRANCH" || \
die "There were merge conflicts."
# TODO: What do we do now?
else
- git merge --squash "$BRANCH" || \
+ git_do merge --squash "$BRANCH" || \
die "There were merge conflicts."
- git commit
+ git_do commit
fi
fi
@@ -250,7 +250,7 @@
[ "$FLAGS_signingkey" != "" ] && opts="$opts -u '$FLAGS_signingkey'"
[ "$FLAGS_message" != "" ] && opts="$opts -m '$FLAGS_message'"
[ "$FLAGS_messagefile" != "" ] && opts="$opts -F '$FLAGS_messagefile'"
- eval git tag $opts "$tagname" "$BRANCH" || \
+ eval git_do tag $opts "$tagname" "$BRANCH" || \
die "Tagging failed. Please run finish again to retry."
fi
fi
@@ -259,41 +259,41 @@
# in case a previous attempt to finish this release branch has failed,
# but the merge into develop was successful, we skip it now
if ! git_is_branch_merged_into "$BRANCH" "$DEVELOP_BRANCH"; then
- git checkout "$DEVELOP_BRANCH" || \
+ git_do checkout "$DEVELOP_BRANCH" || \
die "Could not check out $DEVELOP_BRANCH."
# TODO: Actually, accounting for 'git describe' pays, so we should
# ideally git merge --no-ff $tagname here, instead!
if noflag squash; then
- git merge --no-ff "$BRANCH" || \
+ git_do merge --no-ff "$BRANCH" || \
die "There were merge conflicts."
# TODO: What do we do now?
else
- git merge --squash "$BRANCH" || \
+ git_do merge --squash "$BRANCH" || \
die "There were merge conflicts."
# TODO: What do we do now?
- git commit
+ git_do commit
fi
fi
# delete branch
if noflag keep; then
if [ "$BRANCH" = "$(git_current_branch)" ]; then
- git checkout "$MASTER_BRANCH"
+ git_do checkout "$MASTER_BRANCH"
fi
- git branch -d "$BRANCH"
+ git_do branch -d "$BRANCH"
fi
if flag push; then
- git push "$ORIGIN" "$DEVELOP_BRANCH" || \
+ git_do push "$ORIGIN" "$DEVELOP_BRANCH" || \
die "Could not push to $DEVELOP_BRANCH from $ORIGIN."
- git push "$ORIGIN" "$MASTER_BRANCH" || \
+ git_do push "$ORIGIN" "$MASTER_BRANCH" || \
die "Could not push to $MASTER_BRANCH from $ORIGIN."
if noflag notag; then
- git push --tags "$ORIGIN" || \
+ git_do push --tags "$ORIGIN" || \
die "Could not push tags to $ORIGIN."
fi
- git push "$ORIGIN" :"$BRANCH" || \
+ git_do push "$ORIGIN" :"$BRANCH" || \
die "Could not delete the remote $BRANCH in $ORIGIN."
fi
@@ -324,17 +324,17 @@
# sanity checks
require_clean_working_tree
require_branch "$BRANCH"
- git fetch -q "$ORIGIN"
+ git_do fetch -q "$ORIGIN"
require_branch_absent "$ORIGIN/$BRANCH"
# create remote branch
- git push "$ORIGIN" "$BRANCH:refs/heads/$BRANCH"
- git fetch -q "$ORIGIN"
+ git_do push "$ORIGIN" "$BRANCH:refs/heads/$BRANCH"
+ git_do fetch -q "$ORIGIN"
# configure remote tracking
- git config "branch.$BRANCH.remote" "$ORIGIN"
- git config "branch.$BRANCH.merge" "refs/heads/$BRANCH"
- git checkout "$BRANCH"
+ git_do config "branch.$BRANCH.remote" "$ORIGIN"
+ git_do config "branch.$BRANCH.merge" "refs/heads/$BRANCH"
+ git_do checkout "$BRANCH"
echo
echo "Summary of actions:"
@@ -351,11 +351,11 @@
# sanity checks
require_clean_working_tree
require_branch_absent "$BRANCH"
- git fetch -q "$ORIGIN"
+ git_do fetch -q "$ORIGIN"
require_branch "$ORIGIN/$BRANCH"
# create tracking branch
- git checkout -b "$BRANCH" "$ORIGIN/$BRANCH"
+ git_do checkout -b "$BRANCH" "$ORIGIN/$BRANCH"
echo
echo "Summary of actions:"