From 05ab1c5864e19be7f8c41a258127f87bec75e7b3 Mon Sep 17 00:00:00 2001 From: Wenxuan Zhang Date: Wed, 20 Oct 2021 10:55:53 +0800 Subject: [PATCH] Revert "fix: gcb can switch to an existed branch" This reverts commit 810735294107ef1b1de66cf1cdfc358fc14049ac. --- conf.d/forgit.plugin.fish | 2 +- forgit.plugin.zsh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conf.d/forgit.plugin.fish b/conf.d/forgit.plugin.fish index ab29537..1129619 100644 --- a/conf.d/forgit.plugin.fish +++ b/conf.d/forgit.plugin.fish @@ -217,7 +217,7 @@ function forgit::checkout::branch -d "git checkout branch selector" --argument-n forgit::inside_work_tree || return 1 if test -n "$input_branch_name" - git checkout -B "$input_branch_name" + git checkout -b "$input_branch_name" set checkout_status $status git status --short return $checkout_status diff --git a/forgit.plugin.zsh b/forgit.plugin.zsh index 442fa13..2dce324 100755 --- a/forgit.plugin.zsh +++ b/forgit.plugin.zsh @@ -218,7 +218,7 @@ forgit::checkout::file() { # git checkout-branch selector forgit::checkout::branch() { forgit::inside_work_tree || return 1 - [[ $# -ne 0 ]] && { git checkout -B "$@"; return $?; } + [[ $# -ne 0 ]] && { git checkout -b "$@"; return $?; } local cmd preview opts branch cmd="git branch --color=always --verbose --all | sort -k1.1,1.1 -r" preview="git log {1} --graph --pretty=format:'$forgit_log_format' --color=always --abbrev-commit --date=relative"