From 4015f3cf5d5ab0c339472cf6201dab7ff5285057 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Tue, 25 Jul 2017 14:11:49 +0000 Subject: 41458: _subversion: Don't cache an empty commands list when svn is not available at the first invocation of _svn. --- Completion/Unix/Command/_subversion | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Completion') 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 . + unset _svn_cmds + fi fi fi -- cgit 1.4.1