mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-08-01 06:37:46 +00:00
🐛 fix additional +
in git local branches
(#1019)
Hi! I realized if you use worktrees, with at least one branch checked out and you: ``` git switch <tab> ``` the autocompletion is wrong, putting a `+ ` before the branch, and piping it into the cmdline. This comes from `nu-complete git local branches` function, it which it only replaces `* ` for the current branch, but it doesn't for `+ ` for worktrees. Here is a sample:  I tested on my pc and works allright!
This commit is contained in:
parent
fd686c0b0c
commit
759218de6f
1 changed files with 1 additions and 1 deletions
|
@ -24,7 +24,7 @@ def "nu-complete git commits current branch" [] {
|
|||
|
||||
# Yield local branches like `main`, `feature/typo_fix`
|
||||
def "nu-complete git local branches" [] {
|
||||
^git branch --no-color | lines | each { |line| $line | str replace '* ' "" | str trim }
|
||||
^git branch --no-color | lines | each { |line| $line | str replace '* ' "" | str replace '+ ' "" | str trim }
|
||||
}
|
||||
|
||||
# Yield remote branches like `origin/main`, `upstream/feature-a`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue