about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2017-07-25 14:11:49 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2017-07-28 15:42:42 +0000
commit4015f3cf5d5ab0c339472cf6201dab7ff5285057 (patch)
tree9ca4b1c3dfc49241c1d75e4972ce329409af88e7
parentd4b94b5e8388c744a1d879fecb5af957b170c4c1 (diff)
downloadzsh-4015f3cf5d5ab0c339472cf6201dab7ff5285057.tar.gz
zsh-4015f3cf5d5ab0c339472cf6201dab7ff5285057.tar.xz
zsh-4015f3cf5d5ab0c339472cf6201dab7ff5285057.zip
41458: _subversion: Don't cache an empty commands list when svn is not available at the first invocation of _svn.
-rw-r--r--ChangeLog6
-rw-r--r--Completion/Unix/Command/_subversion7
2 files changed, 12 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index b0dcb7e44..609cf1c22 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-07-28  Daniel Shahaf  <d.s@daniel.shahaf.name>
+
+	* 41458: Completion/Unix/Command/_subversion: Don't cache an
+	empty commands list when svn is not available at the first
+	invocation of _svn.
+
 2017-07-26  Peter Stephenson  <p.stephenson@samsung.com>
 
 	* 41464, 41466 (modified): Doc/Zsh/builtins.yo,
diff --git a/Completion/Unix/Command/_subversion b/Completion/Unix/Command/_subversion
index 640c88950..2f6b567ac 100644
--- a/Completion/Unix/Command/_subversion
+++ b/Completion/Unix/Command/_subversion
@@ -36,7 +36,12 @@ _svn () {
       _svn_cmds=(
 	${=${(f)${${"$(_comp_locale; _call_program commands svn help)"#l#*Available subcommands:}%%Subversion is a tool*}}/(#s)[[:space:]]#(#b)([a-z]##)[[:space:]]#(\([a-z, ?]##\))#/$match[1] :$match[1]${match[2]:+:${${match[2]//[(),]}// /:}}:}
       )
-      _store_cache svn-cmds _svn_cmds
+      if (( $? == 0 )); then
+        _store_cache svn-cmds _svn_cmds
+      else
+        # Ensure we enter this block again on the next <TAB>.
+        unset _svn_cmds
+      fi
     fi
   fi