zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] _git-config: Stop trying to execute the empty string command name upon completing values for an unknown option.
@ 2016-06-25 16:34 Daniel Shahaf
  0 siblings, 0 replies; only message in thread
From: Daniel Shahaf @ 2016-06-25 16:34 UTC (permalink / raw)
  To: zsh-workers

For example:

% git config x.y.z <TAB>
+_git-config:834> case x.y.z (alias.*)
+_git-config:834> case x.y.z (remotes.*)
+_git-config:860> local z=$'\C-@'
+_git-config:861> declare -a parts
+_git-config:862> parts=( '' )
+_git-config:863> ((  1 < 2  ))
+_git-config:863> [[ x.y.z == [^.]##.*.[^.]## ]]
+_git-config:864> parts=( '' )
+_git-config:866> ((  1 > 0  ))
+_git-config:867> case  (-\>*)
+_git-config:867> case  (*)
+_git-config:1197> declare -a action
+_git-config:1198> _description values expl ''
+_git-config:1199> eval 'action=()'
+(eval):1> action=( )
+_git-config:1200> '' -J values
_git-config:1200: permission denied:
+_git-config:1206> return ret
---
 Completion/Unix/Command/_git | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 8bcdff3..2ef7a6d 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -2600,7 +2600,7 @@ _git-config () {
       if (( $#parts < 2 )) && [[ $line[1] == [^.]##.*.[^.]## ]]; then
         parts=("${(S@0)${git_options_static[(r)(#i)${line[1]%%.*}.\*.${line[1]##*.}:*]}//(#b)(*[^\\]|):/$match[1]$z}")
       fi
-      (( $#parts > 0 )) || return ret
+      (( $#parts >= 4 )) || return ret
       case $parts[4] in
         ('->'*)
           case ${parts[4]#->} in


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-06-25 16:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-25 16:34 [PATCH] _git-config: Stop trying to execute the empty string command name upon completing values for an unknown option Daniel Shahaf

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).