_git_bundle ()
{
- local cmd="${words[__git_subcommand_idx+1]}"
+ local cmd="${words[__git_cmd_idx+1]}"
case "$cword" in
- $((__git_subcommand_idx+1)))
+ $((__git_cmd_idx+1)))
__gitcomp "create list-heads verify unbundle"
;;
- $((__git_subcommand_idx+2)))
+ $((__git_cmd_idx+2)))
# looking for a file
;;
*)
esac
case "$cword,$prev" in
- $((__git_subcommand_idx+1)),*|*,-*)
+ $((__git_cmd_idx+1)),*|*,-*)
__git_complete_symbol && return
;;
esac
local subcommand="$(__git_find_on_cmdline "$subcommands save")"
if [ -z "$subcommand" ]; then
- case "$((cword - __git_subcommand_idx)),$cur" in
+ case "$((cword - __git_cmd_idx)),$cur" in
*,--*)
__gitcomp_builtin stash_push
;;
__gitcomp_builtin stash_branch
;;
branch,*)
- if [ $cword -eq $((__git_subcommand_idx+2)) ]; then
+ if [ $cword -eq $((__git_cmd_idx+2)) ]; then
__git_complete_refs
else
__gitcomp_nl "$(__git stash list \
# be either the 'add' subcommand, the unstuck
# argument of an option (e.g. branch for -b|-B), or
# the path for the new worktree.
- if [ $cword -eq $((__git_subcommand_idx+2)) ]; then
+ if [ $cword -eq $((__git_cmd_idx+2)) ]; then
# Right after the 'add' subcommand: have to
# complete the path, so fall back to Bash
# filename completion.
__git_complete_worktree_paths
;;
move,*)
- if [ $cword -eq $((__git_subcommand_idx+2)) ]; then
+ if [ $cword -eq $((__git_cmd_idx+2)) ]; then
# The first parameter must be an existing working
# tree to be moved.
__git_complete_worktree_paths
{
local i c=1 command __git_dir __git_repo_path
local __git_C_args C_args_count=0
- local __git_subcommand_idx
+ local __git_cmd_idx
while [ $c -lt $cword ]; do
i="${words[c]}"
;;
*)
command="$i"
- __git_subcommand_idx="$c"
+ __git_cmd_idx="$c"
break
;;
esac