summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Completion/Unix/Command/_git4
2 files changed, 5 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 7699b6528..7c53f70d1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2017-06-22  Peter Stephenson  <p.stephenson@samsung.com>
 
+	* 41339: Completion/Unix/Command/_git: unquote treeish argument
+	for git checkout completion.
+
 	* Phil: 41308, tweaked: Src/Modules/pcre.c, Test/V07pcre.ztst:
 	Behaviour of PCRE with NULL bytes.
 
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index a46e3b55d..f764daf75 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -495,8 +495,8 @@ _git-checkout () {
 
       elif [[ -n ${opt_args[(I)-b|-B|-t|--track|--orphan|--detach]} ]]; then
         _nothing
-      elif [[ -n $line[1] ]] && __git_is_treeish $line[1]; then
-        __git_ignore_line __git_tree_files ${PREFIX:-.} $line[1] && ret=0
+      elif [[ -n $line[1] ]] && __git_is_treeish ${(Q)line[1]}; then
+        __git_ignore_line __git_tree_files ${PREFIX:-.} ${(Q)line[1]} && ret=0
       else
         __git_ignore_line __git_modified_files && ret=0
       fi