Skip to content

Commit

Permalink
Fix: unnecessary requirement of origin when creating a new feature br…
Browse files Browse the repository at this point in the history
…anch.

Only test if local branch is behind origin if origin exists.
  • Loading branch information
nvie committed Apr 4, 2010
1 parent d79a0d4 commit c118a85
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion git-flow-feature
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,11 @@ cmd_start() {
git fetch -q "$ORIGIN" "$DEVELOP_BRANCH"
fi

require_branches_equal "$DEVELOP_BRANCH" "$ORIGIN/$DEVELOP_BRANCH"
# if the origin branch counterpart exists, assert that the local branch
# isn't behind it (to avoid unnecessary rebasing)
if git_branch_exists "$ORIGIN/$DEVELOP_BRANCH"; then
require_branches_equal "$DEVELOP_BRANCH" "$ORIGIN/$DEVELOP_BRANCH"
fi

# create branch
if ! git checkout -b "$BRANCH" "$BASE"; then
Expand Down

0 comments on commit c118a85

Please sign in to comment.