about summary refs log tree commit diff
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2008-09-01 19:24:54 +0000
committerClint Adams <clint@users.sourceforge.net>2008-09-01 19:24:54 +0000
commit2c9138bc21145c9680d4d10eea6f5e15e73f479c (patch)
tree95cc70e2bcb4020c12e4848ec4e2103db10ee0ea
parenteeed2898142517029c318ed53ece27e0e16ad99f (diff)
downloadzsh-2c9138bc21145c9680d4d10eea6f5e15e73f479c.tar.gz
zsh-2c9138bc21145c9680d4d10eea6f5e15e73f479c.tar.xz
zsh-2c9138bc21145c9680d4d10eea6f5e15e73f479c.zip
25585: fix git command completion when there are arguments after the cursor position.
-rw-r--r--ChangeLog3
-rw-r--r--Completion/Unix/Command/_git16
2 files changed, 11 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 6dc5d8150..e61cc364b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2008-09-01  Clint Adams  <clint@zsh.org>
 
+	* 25585: Completion/Unix/Command/_git: fix git command completion
+	when there are arguments after the cursor position.
+
 	* Frank Terbeck: 25583: Completion/Unix/Command/_git: more git
 	alias fixes.
 
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 05f5c3692..2eec491f9 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -4307,15 +4307,15 @@ if [[ $service == git ]]; then
     '(-p --paginate)'{-p,--paginate}'[pipe output into $PAGER]' \
     '--git-dir=-[path to repository]:directory:_directories' \
     '--bare[use $PWD as repository]' \
-    ':command:->command' \
-    '*::options:->options' && ret=0
+    '*::arg:->cmd_or_options' && return
   case $state in
-    (command)
-      __git_aliases_and_commands
-      ;;
-    (options)
-      curcontext="${curcontext%:*:*}:git-$words[1]:"
-      _call_function ret _git-$words[1]
+    (cmd_or_options)
+      if (( CURRENT == 1 )); then
+        __git_aliases_and_commands
+      else
+        curcontext="${curcontext%:*:*}:git-$words[1]:"
+        _call_function ret _git-$words[1]
+      fi
       ;;
   esac
 else