Use git_do where appropriate
diff --git a/git-flow-init b/git-flow-init
index 00646fe..5b4e7e8 100644
--- a/git-flow-init
+++ b/git-flow-init
@@ -53,7 +53,7 @@
parse_args "$@"
if ! git rev-parse --git-dir >/dev/null 2>&1; then
- git init
+ git_do init
else
# assure that we are not working in a repo with local changes
git_repo_is_headless || require_clean_working_tree
@@ -121,14 +121,14 @@
# name exists, checkout that branch and use it for master
if ! git_local_branch_exists "$master_branch" && \
git_remote_branch_exists "origin/$master_branch"; then
- git branch "$master_branch" "origin/$master_branch" >/dev/null 2>&1
+ git_do branch "$master_branch" "origin/$master_branch" >/dev/null 2>&1
elif ! git_local_branch_exists "$master_branch"; then
die "Local branch '$master_branch' does not exist."
fi
fi
# store the name of the master branch
- git config gitflow.branch.master "$master_branch"
+ git_do config gitflow.branch.master "$master_branch"
fi
# add a develop branch if no such branch exists yet
@@ -185,7 +185,7 @@
fi
# store the name of the develop branch
- git config gitflow.branch.develop "$develop_branch"
+ git_do config gitflow.branch.develop "$develop_branch"
fi
# Creation of HEAD
@@ -194,8 +194,8 @@
# it to be able to create new branches.
local created_gitflow_branch=0
if ! git rev-parse --quiet --verify HEAD >/dev/null 2>&1; then
- git symbolic-ref HEAD "refs/heads/$master_branch"
- git commit --allow-empty --quiet -m "Initial commit"
+ git_do symbolic-ref HEAD "refs/heads/$master_branch"
+ git_do commit --allow-empty --quiet -m "Initial commit"
created_gitflow_branch=1
fi
@@ -213,9 +213,9 @@
# the develop branch now in that case (we base it on master, of course)
if ! git_local_branch_exists "$develop_branch"; then
if git_remote_branch_exists "origin/$develop_branch"; then
- git branch "$develop_branch" "origin/$develop_branch" >/dev/null 2>&1
+ git_do branch "$develop_branch" "origin/$develop_branch" >/dev/null 2>&1
else
- git branch --no-track "$develop_branch" "$master_branch"
+ git_do branch --no-track "$develop_branch" "$master_branch"
fi
created_gitflow_branch=1
fi
@@ -225,7 +225,7 @@
# switch to develop branch if its newly created
if [ $created_gitflow_branch -eq 1 ]; then
- git checkout -q "$develop_branch"
+ git_do checkout -q "$develop_branch"
fi
# finally, ask the user for naming conventions (branch and tag prefixes)
@@ -251,7 +251,7 @@
printf "\n"
fi
[ "$answer" = "-" ] && prefix= || prefix=${answer:-$default_suggestion}
- git config gitflow.prefix.feature "$prefix"
+ git_do config gitflow.prefix.feature "$prefix"
fi
# Release branches
@@ -264,7 +264,7 @@
printf "\n"
fi
[ "$answer" = "-" ] && prefix= || prefix=${answer:-$default_suggestion}
- git config gitflow.prefix.release "$prefix"
+ git_do config gitflow.prefix.release "$prefix"
fi
@@ -278,7 +278,7 @@
printf "\n"
fi
[ "$answer" = "-" ] && prefix= || prefix=${answer:-$default_suggestion}
- git config gitflow.prefix.hotfix "$prefix"
+ git_do config gitflow.prefix.hotfix "$prefix"
fi
@@ -292,7 +292,7 @@
printf "\n"
fi
[ "$answer" = "-" ] && prefix= || prefix=${answer:-$default_suggestion}
- git config gitflow.prefix.support "$prefix"
+ git_do config gitflow.prefix.support "$prefix"
fi
@@ -306,7 +306,7 @@
printf "\n"
fi
[ "$answer" = "-" ] && prefix= || prefix=${answer:-$default_suggestion}
- git config gitflow.prefix.versiontag "$prefix"
+ git_do config gitflow.prefix.versiontag "$prefix"
fi