Skip to content

Commit

Permalink
Merge pull request nvie#222 from sinbad/feature/fix_default_behaviour
Browse files Browse the repository at this point in the history
Fix init -d behaviour when master branch exists, and 1+ other branches exist, but develop does not
  • Loading branch information
nvie committed Jul 9, 2012
2 parents ab7fda2 + 2632778 commit c26286e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion git-flow-init
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,17 @@ cmd_default() {
default_suggestion=
for guess in $(git config --get gitflow.branch.develop) \
'develop' 'int' 'integration' 'master'; do
if git_local_branch_exists "$guess"; then
if git_local_branch_exists "$guess" && [ "$guess" != "$master_branch" ]; then
default_suggestion="$guess"
break
fi
done

if [ -z $default_suggestion ]; then
should_check_existence=NO
default_suggestion=$(git config --get gitflow.branch.develop || echo develop)
fi

fi

printf "Branch name for \"next release\" development: [$default_suggestion] "
Expand Down

0 comments on commit c26286e

Please sign in to comment.