1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-08-01 14:47:47 +00:00

Fix git checkout/switch completions (#359)

This commit is contained in:
Marc Schreiber 2023-01-24 13:02:58 +01:00 committed by GitHub
parent e89b4ac6be
commit 6801071f50
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,7 +6,7 @@ def "nu-complete git switchable branches" [] {
let remotes_regex = (["(", ((nu-complete git remotes | each {|r| ['remotes/', $r, '/'] | str join}) | str join "|"), ")"] | str join)
^git branch -a
| lines
| parse -r (['^[\* ]+', $remotes_regex, '?(?P<branch>\w+)'] | flatten | str join)
| parse -r (['^[\* ]+', $remotes_regex, '?(?P<branch>\S+)'] | flatten | str join)
| get branch
| uniq
| where {|branch| $branch != "HEAD"}