about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2016-09-30 09:57:50 +0200
committerOliver Kiddle <opk@zsh.org>2016-09-30 09:57:50 +0200
commit13d0b278be9f9f10655a53a88b863351d85b523d (patch)
tree11dbc8c982687e8de77599c5c7434b21eef2efa8
parent573895dd60974354cdabd0632bd0367d04e7ddbc (diff)
downloadzsh-13d0b278be9f9f10655a53a88b863351d85b523d.tar.gz
zsh-13d0b278be9f9f10655a53a88b863351d85b523d.tar.xz
zsh-13d0b278be9f9f10655a53a88b863351d85b523d.zip
39514: pass on --git-dir when calling git to get completion matches
-rw-r--r--ChangeLog2
-rw-r--r--Completion/Unix/Command/_git2
2 files changed, 3 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 6936d137e..8450407c8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2016-09-30  Oliver Kiddle  <opk@zsh.org>
 
+	* 39514: Completion/Unix/Command/_git: handle --git-dir
+
 	* 39513: Completion/Unix/Command/_doas: new doas completion
 
 	* 39464: Completion/Solaris/Command/_fmadm: fix where lack
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index a00e1d7ac..80b2c55af 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