completion: fix warning for zsh
authorFelipe Contreras <felipe.contreras@gmail.com>
Thu, 29 Nov 2012 08:20:57 +0000 (09:20 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 29 Nov 2012 16:47:51 +0000 (08:47 -0800)
Otherwise the user might get something like:

  git-completion.sh:2466: command not found: compdef

If this script is loaded before compinit. The script would work either
way, but let's not be more annoying to the user.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-completion.bash

index af13fcc440876f4b851724050548e399a4b90d31..0b77eb1fa4074fb8ed5ef4cd4c37513f49804e7e 100644 (file)
@@ -2404,6 +2404,8 @@ __gitk_main ()
 if [[ -n ${ZSH_VERSION-} ]]; then
        echo "WARNING: this script is deprecated, please see git-completion.zsh" 1>&2
 
+       autoload -U +X compinit && compinit
+
        __gitcomp ()
        {
                emulate -L zsh