Skip to content
This repository has been archived by the owner on Jun 19, 2023. It is now read-only.

Fix branch existence checks of hotfix track #376

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions git-flow-hotfix
Original file line number Diff line number Diff line change
Expand Up @@ -345,17 +345,18 @@ showcommands! Show git commands while executing them

# Sanity checks
require_clean_working_tree
require_branch_absent "$BRANCH"
git_do fetch -q "$ORIGIN"
require_branch "$ORIGIN/$BRANCH"
require_local_branch_absent "$BRANCH"

git_do fetch -q "$ORIGIN" || die "Could not fetch branch '$BRANCH' from remote '$ORIGIN'."
git_remote_branch_exists "$ORIGIN/$BRANCH"

# Create tracking branch
git_do checkout -b "$BRANCH" "$ORIGIN/$BRANCH"
git_do checkout -b "$BRANCH" "$ORIGIN/$BRANCH" || die "Could not create branch '$BRANCH'."

echo
echo "Summary of actions:"
echo "- A new remote tracking branch '$BRANCH' was created"
echo "- You are now on branch '$BRANCH'"
echo "- You are now on branch '$(git_current_branch)'"
echo
}

Expand Down