1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-01 21:51:40 +02:00

42364: _git: fix __git_ignore_line to ignore the current word

Before this patch "git branch -d master<tab>" would result in
"no matches found", while "master" itself should get completed here.

The "(bQ)" (added in 527badc23, via 38129?!) does not seem to be necessary
anymore: with files "f\[a-z\]o" and "foo", "git add f[a-z]o <tab>"
offers "f\[a-z\]o", but not "foo".
This commit is contained in:
Daniel Hahler 2018-02-14 01:18:59 +01:00
parent 5b946f6c4d
commit 1142e2dedb
2 changed files with 6 additions and 6 deletions

View file

@ -1,3 +1,8 @@
2018-02-22 Daniel Hahler <zsh@thequod.de>
* 42364: Completion/Unix/Command/_git: _git: fix __git_ignore_line to
ignore the current word.
2018-02-17 Peter Stephenson <p.w.stephenson@ntlworld.com>
* 42362: Src/jobs.c: protet REPORTTIME logic from bad status.

View file

@ -5596,12 +5596,7 @@ __git_describe_commit () {
# .
(( $+functions[__git_ignore_line] )) ||
__git_ignore_line () {
declare -a ignored
ignored=()
((CURRENT > 1)) &&
ignored+=(${(bQ)line[1,CURRENT-1]})
((CURRENT < $#line)) &&
ignored+=(${(bQ)line[CURRENT+1,-1]})
local -a ignored=(${line:#${words[CURRENT]}})
$* -F ignored
}