Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: nu-complete for git ref and git files-and-ref uses nu-complete git switch now #906

Merged
merged 1 commit into from
Jul 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions custom-completions/git/git-completions.nu
Original file line number Diff line number Diff line change
Expand Up @@ -126,20 +126,15 @@ def "nu-complete git built-in-refs" [] {
}

def "nu-complete git refs" [] {
nu-complete git switchable branches
| parse "{value}"
| insert description Branch
| append (nu-complete git tags | parse "{value}" | insert description Tag)
| append (nu-complete git built-in-refs)
nu-complete git switch
| update description Branch
| append (nu-complete git tags | update description Tag)
| append (nu-complete git built-in-refs | wrap value | insert description Ref)
}

def "nu-complete git files-or-refs" [] {
nu-complete git switchable branches
| parse "{value}"
| insert description Branch
| append (nu-complete git files | where description == "Modified" | select value)
| append (nu-complete git tags | parse "{value}" | insert description Tag)
| append (nu-complete git built-in-refs)
nu-complete git refs
| prepend (nu-complete git files | where description == "Modified")
}

def "nu-complete git subcommands" [] {
Expand Down