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

[PATCH] _git: Quote the return value of __git_committish_range{first,last}



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



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