* [PATCH] _git: Quote the return value of __git_committish_range{first,last}
@ 2015-08-12 9:36 Wieland Hoffmann
2015-08-13 23:18 ` Daniel Shahaf
0 siblings, 1 reply; 2+ messages in thread
From: Wieland Hoffmann @ 2015-08-12 9:36 UTC (permalink / raw)
To: zsh-workers; +Cc: Wieland Hoffmann
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] _git: Quote the return value of __git_committish_range{first,last}
2015-08-12 9:36 [PATCH] _git: Quote the return value of __git_committish_range{first,last} Wieland Hoffmann
@ 2015-08-13 23:18 ` Daniel Shahaf
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Shahaf @ 2015-08-13 23:18 UTC (permalink / raw)
To: Wieland Hoffmann; +Cc: zsh-workers
Wieland Hoffmann wrote on Wed, Aug 12, 2015 at 11:36:17 +0200:
> Otherwise, __git_is_committish_range performs word splitting if it's
> passed a range that includes spaces (like "master@{1 week ago}..master").
...
> - 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)"
I see this has been applied, but for future reference, note that it is
only necessary for 5.0.8 and older, since in zsh from git 'local' is
a reserved word and
local x=$(echo foo bar)
doesn't perform word splitting.
Cheers,
Daniel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-08-13 23:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-12 9:36 [PATCH] _git: Quote the return value of __git_committish_range{first,last} Wieland Hoffmann
2015-08-13 23:18 ` 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).