about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Unix/Command/_git16
1 files changed, 8 insertions, 8 deletions
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