Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Ohmyzsh
Commits
d0554456
Unverified
Commit
d0554456
authored
Oct 27, 2020
by
Felipe Contreras
Committed by
GitHub
Oct 27, 2020
Browse files
gitfast: fetch latest fixes from git-completion (#9390)
Signed-off-by:
Felipe Contreras
<
felipe.contreras@gmail.com
>
parent
bad9ee00
Changes
2
Show whitespace changes
Inline
Side-by-side
plugins/gitfast/_git
View file @
d0554456
...
@@ -27,19 +27,26 @@ zstyle -T ':completion:*:*:git:*' tag-order && \
...
@@ -27,19 +27,26 @@ zstyle -T ':completion:*:*:git:*' tag-order && \
zstyle -s ":completion:*:*:git:*" script script
zstyle -s ":completion:*:*:git:*" script script
if [ -z "$script" ]; then
if [ -z "$script" ]; then
local -a locations
local -a locations
local e
local e bash_completion
bash_completion=$(pkg-config --variable=completionsdir bash-completion 2>/dev/null) ||
bash_completion='/usr/share/bash-completion/completions/'
locations=(
locations=(
"$(dirname ${funcsourcetrace[1]%:*})"/git-completion.bash
"$(dirname ${funcsourcetrace[1]%:*})"/git-completion.bash
"$HOME/.local/share/bash-completion/completions/git"
"$HOME/.local/share/bash-completion/completions/git"
"$(pkg-config --variable=completionsdir bash-completion)"/git
"$bash_completion/git"
'/usr/share/bash-completion/completions/git'
'/etc/bash_completion.d/git' # old debian
'/etc/bash_completion.d/git' # old debian
)
)
for e in $locations; do
for e in $locations; do
test -f $e && script="$e" && break
test -f $e && script="$e" && break
done
done
fi
fi
local old_complete="$functions[complete]"
functions[complete]=:
GIT_SOURCING_ZSH_COMPLETION=y . "$script"
GIT_SOURCING_ZSH_COMPLETION=y . "$script"
functions[complete]="$old_complete"
__gitcomp ()
__gitcomp ()
{
{
...
@@ -105,26 +112,26 @@ __gitcomp_nl ()
...
@@ -105,26 +112,26 @@ __gitcomp_nl ()
compadd -Q -S "${4- }" -p "${2-}" -- ${(f)1} && _ret=0
compadd -Q -S "${4- }" -p "${2-}" -- ${(f)1} && _ret=0
}
}
__gitcomp_
nl_append
()
__gitcomp_
file
()
{
{
emulate -L zsh
emulate -L zsh
compset -P '*[=:]'
compadd -f -p "${2-}" -- ${(f)1} && _ret=0
compadd -Q -S "${4- }" -p "${2-}" -- ${(f)1} && _ret=0
}
}
__gitcomp_
file_
direct ()
__gitcomp_direct
_append
()
{
{
emulate -L zsh
__gitcomp_direct "$@"
compadd -f -- ${(f)1} && _ret=0
}
}
__gitcomp_
file
()
__gitcomp_
nl_append
()
{
{
emulate -L zsh
__gitcomp_nl "$@"
}
compadd -f -p "${2-}" -- ${(f)1} && _ret=0
__gitcomp_file_direct ()
{
__gitcomp_file "$1" ""
}
}
_git_zsh ()
_git_zsh ()
...
...
plugins/gitfast/git-completion.bash
View file @
d0554456
...
@@ -3585,7 +3585,6 @@ __git_func_wrap ()
...
@@ -3585,7 +3585,6 @@ __git_func_wrap ()
# This is NOT a public function; use at your own risk.
# This is NOT a public function; use at your own risk.
__git_complete
()
__git_complete
()
{
{
test
-n
"
$ZSH_VERSION
"
&&
return
local
wrapper
=
"__git_wrap
${
2
}
"
local
wrapper
=
"__git_wrap
${
2
}
"
eval
"
$wrapper
() { __git_func_wrap
$2
; }"
eval
"
$wrapper
() { __git_func_wrap
$2
; }"
complete
-o
bashdefault
-o
default
-o
nospace
-F
$wrapper
$1
2>/dev/null
\
complete
-o
bashdefault
-o
default
-o
nospace
-F
$wrapper
$1
2>/dev/null
\
...
@@ -3607,8 +3606,7 @@ if ! git --list-cmds=main >/dev/null 2>&1; then
...
@@ -3607,8 +3606,7 @@ if ! git --list-cmds=main >/dev/null 2>&1; then
{
{
case
"
$1
"
in
case
"
$1
"
in
--list-cmds
=
*
)
--list-cmds
=
*
)
IFS
=
,
read
-r
-a
cmds
<<<
"
${
1
##--list-cmds=
}
"
while
read
-r
-d
','
x
;
do
for
x
in
${
cmds
[@]
}
;
do
case
"
$x
"
in
case
"
$x
"
in
nohelpers
)
nohelpers
)
;;
;;
...
@@ -3620,7 +3618,7 @@ if ! git --list-cmds=main >/dev/null 2>&1; then
...
@@ -3620,7 +3618,7 @@ if ! git --list-cmds=main >/dev/null 2>&1; then
echo
${
__git_cmds
[
$x
]
}
echo
${
__git_cmds
[
$x
]
}
;;
;;
esac
esac
done
done
<<<
"
${
1
##--list-cmds=
}
,"
return
return
;;
;;
esac
esac
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment