Commit ef43cbd6 authored by Vincent Driessen's avatar Vincent Driessen

Check whether this is a freshly git init'ed repo that's still HEADless. In

that case, don't check if the working tree is clean (this yields errors in
HEADless repos).

This fix enabled users to use "git init && git flow init", too.
parent c1598bf2
......@@ -30,12 +30,8 @@ cmd_default() {
if ! git rev-parse --git-dir >/dev/null 2>&1; then
git init
else
# TODO: This still fails when running:
# git init
# git flow init
# assure that we are not working in a repo with local changes
gitflow_require_clean_working_tree
git_repo_is_headless || gitflow_require_clean_working_tree
fi
# running git flow init on an already initialized repo is fine
......
......@@ -154,6 +154,10 @@ gitflow_require_initialized() {
fi
}
git_repo_is_headless() {
! git rev-parse --quiet --verify HEAD >/dev/null 2>&1
}
gitflow_require_clean_working_tree() {
gitflow_test_clean_working_tree
local result=$?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment