Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: 3.0.8: git completion update for cherry-pick



Daniel Shahaf wrote on Sun, Aug 30, 2015 at 22:39:45 +0000:
> I've made a few changes (see attached series):
...
> 3. Extra safety check in case somebody passed just the traditional '-O
> expl' with no colon
...
> -  (( $#argument_array_names > 1 )) && commit_opts=( "${(@P)argument_array_names[2]}" )
> +  (( $#argument_array_names > 1 )) && && ${(P)+argument_array_names[2]} &&
> +    commit_opts=( "${(@P)argument_array_names[2]}" )

That was an invalid syntax.

diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 2c79ed0..7f7c3eb 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -5645,7 +5645,7 @@ __git_recent_commits () {
   zparseopts -D -E O:=argument_array_names
   # Turn (-O foo:bar) to (foo bar)
   (( $#argument_array_names )) && argument_array_names=( "${(@s/:/)argument_array_names[2]}" )
-  (( $#argument_array_names > 1 )) && && ${(P)+argument_array_names[2]} &&
+  (( $#argument_array_names > 1 )) && (( ${(P)+argument_array_names[2]} )) &&
     commit_opts=( "${(@P)argument_array_names[2]}" )
 
   # Careful: most %d will expand to the empty string.  Quote properly!



Messages sorted by: Reverse Date, Date, Thread, Author