fix: review comments

- stash_push: use _git_add instead of _git_stash for file path
  completion, consistent with zsh side
- switch_branch: use _git_checkout_branch instead of undefined
  _git_switch_branch
This commit is contained in:
Wenxuan Zhang 2026-03-10 16:33:29 +08:00 committed by Wenxuan
parent 5182bb459d
commit 4c60265e4f

View file

@ -124,7 +124,7 @@ _git_forgit()
show) _git_show ;;
squash) _git_log ;;
stash_show) _git_stash_show ;;
stash_push) _git_stash ;;
stash_push) _git_add ;;
switch_branch) _git_checkout_branch ;;
worktree) _git_worktree ;;
worktree_delete) _git_worktrees ;;
@ -148,7 +148,7 @@ then
__git_complete forgit::add _git_add
__git_complete forgit::branch::delete _git_branch_delete
__git_complete forgit::checkout::branch _git_checkout_branch
__git_complete forgit::switch::branch _git_switch_branch
__git_complete forgit::switch::branch _git_checkout_branch
__git_complete forgit::checkout::commit _git_checkout
__git_complete forgit::checkout::file _git_checkout_file
__git_complete forgit::checkout::tag _git_checkout_tag
@ -166,7 +166,7 @@ then
__git_complete forgit::show _git_show
__git_complete forgit::squash _git_log
__git_complete forgit::stash::show _git_stash_show
__git_complete forgit::stash::push _git_stash
__git_complete forgit::stash::push _git_add
__git_complete forgit::worktree _git_worktree
__git_complete forgit::worktree::delete _git_worktrees
@ -175,7 +175,7 @@ then
__git_complete "${forgit_add}" _git_add
__git_complete "${forgit_branch_delete}" _git_branch_delete
__git_complete "${forgit_checkout_branch}" _git_checkout_branch
__git_complete "${forgit_switch_branch}" _git_switch_branch
__git_complete "${forgit_switch_branch}" _git_checkout_branch
__git_complete "${forgit_checkout_commit}" _git_checkout
__git_complete "${forgit_checkout_file}" _git_checkout_file
__git_complete "${forgit_checkout_tag}" _git_checkout_tag
@ -192,7 +192,7 @@ then
__git_complete "${forgit_show}" _git_show
__git_complete "${forgit_squash}" _git_log
__git_complete "${forgit_stash_show}" _git_stash_show
__git_complete "${forgit_stash_push}" _git_stash
__git_complete "${forgit_stash_push}" _git_add
__git_complete "${forgit_worktree}" _git_worktree
__git_complete "${forgit_worktree_delete}" _git_worktrees
fi