From e22fe806e8ec35b6e55284608efaa32c1aeb0db2 Mon Sep 17 00:00:00 2001 From: blooper05 Date: Mon, 25 Jun 2018 11:00:17 +0900 Subject: [PATCH] Fix branch existence checks of `hotfix track` --- git-flow-hotfix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/git-flow-hotfix b/git-flow-hotfix index f97ed44a..39253c37 100644 --- a/git-flow-hotfix +++ b/git-flow-hotfix @@ -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 }