mirror of
https://github.com/wfxr/forgit.git
synced 2026-09-10 07:16:23 -04:00
refactor: ci lint
This commit is contained in:
parent
ed51746687
commit
5d15fd3532
4
.github/pull_request_template.md
vendored
4
.github/pull_request_template.md
vendored
|
|
@ -24,8 +24,8 @@
|
|||
|
||||
- Shell
|
||||
- [ ] bash
|
||||
- [ ] zsh
|
||||
- [ ] fish
|
||||
- [ ] zsh
|
||||
- [ ] fish
|
||||
- OS
|
||||
- [ ] Linux
|
||||
- [ ] Mac OS X
|
||||
|
|
|
|||
|
|
@ -229,10 +229,10 @@ forgit::checkout::branch() {
|
|||
"
|
||||
branch="$(eval "$cmd" | FZF_DEFAULT_OPTS="$opts" fzf --preview="$preview" | awk '{print $1}')"
|
||||
[[ -z "$branch" ]] && return 1
|
||||
|
||||
|
||||
# track the remote branch if possible
|
||||
if [[ "$branch" == "remotes/origin/"* ]]; then
|
||||
if [[ -n $(git branch | grep -w "${branch#remotes/origin/}") ]]; then
|
||||
if git branch | grep -qw "${branch#remotes/origin/}"; then
|
||||
# hack to force creating a new branch which tracks the remote if a local branch already exists
|
||||
git checkout -b "track/${branch#remotes/origin/}" --track "$branch"
|
||||
elif ! git checkout --track "$branch" 2>/dev/null; then
|
||||
|
|
|
|||
Loading…
Reference in a new issue