zsh-workers
 help / color / mirror / code / Atom feed
From: Wieland Hoffmann <themineo@gmail.com>
To: zsh-workers@zsh.org
Cc: Wieland Hoffmann <themineo@gmail.com>
Subject: [PATCH] _git: Quote the return value of __git_committish_range{first,last}
Date: Wed, 12 Aug 2015 11:36:17 +0200	[thread overview]
Message-ID: <1439372177-32218-1-git-send-email-themineo@gmail.com> (raw)

Otherwise, __git_is_committish_range performs word splitting if it's
passed a range that includes spaces (like "master@{1 week ago}..master").
---
 Completion/Unix/Command/_git | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 5b78a2b..f5dbbae 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -4973,8 +4973,8 @@ __git_is_treeish () {
 (( $+functions[__git_is_committish_range] )) ||
 __git_is_committish_range () {
   [[ $1 == *..(.|)* ]] || return 1
-  local first=$(__git_committish_range_first $1)
-  local last=$(__git_committish_range_last $1)
+  local first="$(__git_committish_range_first $1)"
+  local last="$(__git_committish_range_last $1)"
   [[ $first != *..* && $last != *..* ]] && \
     __git_is_committish $first && \
     __git_is_committish $last
-- 
2.5.0


             reply	other threads:[~2015-08-12  9:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-12  9:36 Wieland Hoffmann [this message]
2015-08-13 23:18 ` Daniel Shahaf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1439372177-32218-1-git-send-email-themineo@gmail.com \
    --to=themineo@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).