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

PATCH: git completion - pass on --git-dir option



Various aspects of git completion don't work if the option --git-dir is
used. This solves that by putting the value in $GIT_DIR.

Oliver

diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 2178b82..c89ab56 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -7484,7 +7484,7 @@ _git() {
         ;;
       (option-or-argument)
         curcontext=${curcontext%:*:*}:git-$words[1]:
-
+	(( $+opt_args[--git-dir] )) && local -x GIT_DIR=$opt_args[--git-dir]
 	if ! _call_function ret _git-$words[1]; then
 	  if zstyle -T :completion:$curcontext: use-fallback; then
 	    _default && ret=0



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