#compdef git-ff
#description fast-forward to a remote branch.

# to get the functionality of _git, I really have to *invoke* it!
# autoload __git_remotes _git

# I need this as I invoke other _functions:
_git-ff()
{
    # I need this as I invoke other _functions:
    local curcontext="$curcontext" state line

    _arguments -C -s -S  \
               '-h[help]' \
               '-l[list]' \
               '-u[fetch]' \
               '1:remote repository:->git_remotes'\
               '2:local branch:->git_branch'&& return 0

    # only this works:
    case $state in
        git_remotes)
            _alternative \
                'remote:remote:__git_remotes'
            ;;
        git_branch)
            _alternative 'branch::__git_branch_names'
            ;;
        *)
            ;; # _files
    esac
}


if [[ ! $words[1] = 'git' ]]
then
    words[1]=(git "ff")
    (( CURRENT++ ))
else
    # echo "already divided: $words[1] vs $words[2]">&2
    :
fi

# Invoke:
service=git;
_git
