mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-16 15:21:14 -03:00
completions/git: Fix git-foo commands
Broken in f5711ad5ed, this neglected to
remove the `git-` part from the command
Fixes #9457.
This commit is contained in:
@@ -33,6 +33,19 @@ git init >/dev/null 2>&1
|
||||
# First set up a test alias - *before loading the completions*
|
||||
git config --local alias.re 'restore --staged'
|
||||
|
||||
# Test custom command completions by adding a command:
|
||||
|
||||
set -p PATH $PWD
|
||||
echo "echo foo" > git-frobnicate
|
||||
chmod +x git-frobnicate
|
||||
|
||||
complete -c git-frobnicate -xa 'foo bar baz'
|
||||
|
||||
complete -C'git frobnicate '
|
||||
#CHECK: bar
|
||||
#CHECK: baz
|
||||
#CHECK: foo
|
||||
|
||||
complete -C'git ' | grep '^add'\t
|
||||
# (note: actual tab character in the check here)
|
||||
#CHECK: add Add file contents to the staging area
|
||||
@@ -41,9 +54,11 @@ touch foo
|
||||
|
||||
complete -C'git add '
|
||||
#CHECK: foo Untracked file
|
||||
#CHECK: git-frobnicate Untracked file
|
||||
|
||||
complete -C'git add :'
|
||||
#CHECK: :/:foo Untracked file
|
||||
#CHECK: :/:git-frobnicate Untracked file
|
||||
|
||||
git config alias.s status
|
||||
complete 'git s --s'
|
||||
@@ -71,7 +86,7 @@ set -g __fish_git_prompt_show_informative_status 1
|
||||
set -g __fish_git_prompt_showuntrackedfiles 1
|
||||
fish_git_prompt
|
||||
echo
|
||||
#CHECK: (newbranch|…1)
|
||||
#CHECK: (newbranch|…2)
|
||||
set -e __fish_git_prompt_show_informative_status
|
||||
set -e __fish_git_prompt_showuntrackedfiles
|
||||
|
||||
|
||||
Reference in New Issue
Block a user