about summary refs log tree commit diff
path: root/Completion/Unix/Command/_git
diff options
context:
space:
mode:
authorPeter Stephenson <p.stephenson@samsung.com>2018-05-08 17:13:12 +0100
committerPeter Stephenson <p.stephenson@samsung.com>2018-05-08 17:13:12 +0100
commitfa441fa20e6d7d93e613f339d0c67ba8b0ab09c4 (patch)
tree0f1bc45a082dedcc079f30e3ce9bc6460032e87f /Completion/Unix/Command/_git
parentc8ceb66ba3b0978762e52715f1f59918ae58e153 (diff)
downloadzsh-fa441fa20e6d7d93e613f339d0c67ba8b0ab09c4.tar.gz
zsh-fa441fa20e6d7d93e613f339d0c67ba8b0ab09c4.tar.xz
zsh-fa441fa20e6d7d93e613f339d0c67ba8b0ab09c4.zip
42752: enhance git external alias completion
If alias expands to !cmd-name, complete as a normal command
line after cmd-name.
Diffstat (limited to 'Completion/Unix/Command/_git')
-rw-r--r--Completion/Unix/Command/_git5
1 files changed, 4 insertions, 1 deletions
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index f6cec8b60..21ba65724 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -7758,7 +7758,10 @@ _git() {
         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
+	  if [[ $words[1] = \!* ]]; then
+	    words[1]=${words[1]##\!}
+	    _normal && ret=0
+	  elif zstyle -T :completion:$curcontext: use-fallback; then
 	    _default && ret=0
 	  else
 	    _message "unknown sub-command: $words[1]"