From 7c3c28f4097d39c24fb9563ad440dcaf73947beb Mon Sep 17 00:00:00 2001 From: Chris Apple <14171107+cjappl@users.noreply.github.com> Date: Tue, 6 Feb 2024 06:30:33 -0800 Subject: [PATCH] Removing dispatch function --- completions/_git-forgit | 94 +---------------------------------------- 1 file changed, 1 insertion(+), 93 deletions(-) diff --git a/completions/_git-forgit b/completions/_git-forgit index d45295a..6e543e2 100644 --- a/completions/_git-forgit +++ b/completions/_git-forgit @@ -114,101 +114,9 @@ compdef _git-staged forgit::reset::head compdef __git_recent_commits forgit::revert::commit compdef _git-stash-show forgit::stash::show -_forgit-dispatch() { - subcommand="${words[1]}" - - if [[ $subcommand == "forgit::add" ]]; then - _git-add - return - fi - - if [[ $subcommand == "forgit::branch::delete" ]]; then - _git-branches - return - fi - - if [[ $subcommand == "forgit::checkout::branch" ]]; then - _git-branches - return - fi - - if [[ $subcommand == "forgit::checkout::commit" ]]; then - __git_recent_commits - return - fi - - if [[ $subcommand == "forgit::checkout::file" ]]; then - _git-checkout-file - return - fi - - if [[ $subcommand == "forgit::checkout::tag" ]]; then - __git_tags - return - fi - - if [[ $subcommand == "forgit::cherry::pick" ]]; then - _git-cherry-pick - return - fi - - if [[ $subcommand == "forgit::cherry::pick::from::branch" ]]; then - _git-branches - return - fi - - if [[ $subcommand == "forgit::clean" ]]; then - _git-clean - return - fi - - if [[ $subcommand == "forgit::diff" ]]; then - _git-forgit-diff - return - fi - - if [[ $subcommand == "forgit::fixup" ]]; then - __git_branch_names - return - fi - - if [[ $subcommand == "forgit::log" ]]; then - _git-log - return - fi - - if [[ $subcommand == "forgit::rebase" ]]; then - _git-rebase - return - fi - - if [[ $subcommand == "forgit::reset::head" ]]; then - _git-staged - return - fi - - if [[ $subcommand == "forgit::revert::commit" ]]; then - __git_recent_commits - return - fi - - if [[ $subcommand == "forgit::stash::show" ]]; then - _git-stash-show - return - fi - - # this is the case of calling "git forgit" - if [[ $subcommand == "forgit" ]]; then - _git-forgit - return - fi - - return 1 -} - # this is the case of calling the command and pressing tab # the very first time of a shell session, we have to manually # call the dispatch function if [[ $funcstack[1] == "_git-forgit" ]]; then - _forgit-dispatch "$@" + _git-forgit "$@" fi