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

PATCH: git object type detection



More quoting woes --- I suspect this change needs to be applied in other
places.

git checkout HEAD\^

didn't complete the right set of files after it because it didn't
recognise HEAD\^ as "treeish" because git didn't like the backslash.
Remove that and it works.

diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index a46e3b5..f764daf 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

pws



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