summaryrefslogtreecommitdiff
path: root/Completion/Unix/Command/_git
diff options
context:
space:
mode:
authorDaniel Hahler <git@thequod.de>2018-02-14 01:18:59 +0100
committerDaniel Hahler <git@thequod.de>2018-02-22 23:41:13 +0100
commit1142e2dedb628352bb6a45f58fed0fd29b0725a9 (patch)
treec370535fd0916cf0e5fe6ee7c5d04509e5a89413 /Completion/Unix/Command/_git
parent5b946f6c4ddb82d2436c5012e719d470802987d0 (diff)
downloadzsh-1142e2dedb628352bb6a45f58fed0fd29b0725a9.tar.gz
zsh-1142e2dedb628352bb6a45f58fed0fd29b0725a9.zip
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".
Diffstat (limited to 'Completion/Unix/Command/_git')
-rw-r--r--Completion/Unix/Command/_git7
1 files changed, 1 insertions, 6 deletions
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 9f0225fab..4df851c98 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -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
}