about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2007-10-01 19:34:53 +0000
committerClint Adams <clint@users.sourceforge.net>2007-10-01 19:34:53 +0000
commitea7809d5a7e1558e27715a82a369cfcd9678de63 (patch)
tree0479dd036fcdd713386f86dfe52e8fafc9941eb5 /Completion
parent44b2e3e2b20c96a27c6aaf246202eaf3e2bbd214 (diff)
downloadzsh-ea7809d5a7e1558e27715a82a369cfcd9678de63.tar.gz
zsh-ea7809d5a7e1558e27715a82a369cfcd9678de63.tar.xz
zsh-ea7809d5a7e1558e27715a82a369cfcd9678de63.zip
Nikolai Weibull: 23888: complete branch names and cached files after git log.
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Unix/Command/_git13
1 files changed, 12 insertions, 1 deletions
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 5d4a181e2..25d446869 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -1702,11 +1702,22 @@ _git-grep () {
 
 (( $+functions[_git-log] )) ||
 _git-log () {
+  local curcontext=$curcontext state line
+  declare -A opt_args
+
   __git_setup_revision_arguments
 
   _arguments -S \
     $revision_arguments \
-    '*:file:__git_cached_files' && ret=0
+    '*:file-or-branch:->files' && ret=0
+
+  case $state in
+    (files)
+      _alternative \
+        'files:index file:__git_cached_files' \
+        'branches:branch:__git_branch_names' && ret=0
+      ;;
+  esac
 }
 
 # TODO: repository needs fixing