mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-19 03:31:14 +02:00
49345: fix git file completion for paths starting with ../
This commit is contained in:
parent
64befeb4ca
commit
b60bab1cc1
2 changed files with 9 additions and 4 deletions
|
@ -1,3 +1,8 @@
|
|||
2021-09-04 Oliver Kiddle <opk@zsh.org>
|
||||
|
||||
* 49345: Completion/Unix/Command/_git: fix git file completion
|
||||
for paths starting with ../
|
||||
|
||||
2021-08-29 Oliver Kiddle <opk@zsh.org>
|
||||
|
||||
* 49327: Completion/Unix/Command/_git: complete for new git
|
||||
|
|
|
@ -7370,7 +7370,6 @@ __git_changed_files () {
|
|||
# which case it is relative to the repository root.
|
||||
(( $+functions[__git_tree_files] )) ||
|
||||
__git_tree_files () {
|
||||
local multi_parts_opts
|
||||
local tree Path
|
||||
integer at_least_one_tree_added
|
||||
local -a tree_files compadd_opts
|
||||
|
@ -7383,11 +7382,12 @@ __git_tree_files () {
|
|||
|
||||
zparseopts -D -E -a compadd_opts V+: J+: 1 2 o+: n f x+: X+: M+: P: S: r: R: q F:
|
||||
|
||||
[[ "$1" == */ ]] && Path="$1" || Path="${1:h}/"
|
||||
Path=${(M)1##(../)#}
|
||||
[[ ${1##(../)#} = */* ]] && extra_args+=( -r )
|
||||
shift
|
||||
(( at_least_one_tree_added = 0 ))
|
||||
for tree in $*; do
|
||||
tree_files+=(${(ps:\0:)"$(_call_program tree-files git ls-tree -r ${(q)extra_args} --name-only -z ${(q)tree} 2>/dev/null)"})
|
||||
for tree; do
|
||||
tree_files+=(${(ps:\0:)"$(_call_program tree-files git ls-tree $extra_args --name-only -z ${(q)tree} $Path 2>/dev/null)"})
|
||||
__git_command_successful $pipestatus && (( at_least_one_tree_added = 1 ))
|
||||
done
|
||||
|
||||
|
|
Loading…
Reference in a new issue