Commit c118a85b authored by Vincent Driessen's avatar Vincent Driessen

Fix: unnecessary requirement of origin when creating a new feature branch.

Only test if local branch is behind origin if origin exists.
parent d79a0d45
......@@ -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
......
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