completion: fix warning for zsh

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>

Felipe Contreras committed Nov 29, 2012 at 09:20 UTC 9cd67bd2efe98968531cb15cb0d32abdc79e06c1
1 file changed +2
contrib/completion/git-completion.bash
+2
@@ -2404,6 +2404,8 @@ __gitk_main ()
2404 if [[ -n ${ZSH_VERSION-} ]]; then
2405 echo "WARNING: this script is deprecated, please see git-completion.zsh" 1>&2
2406
2407 + autoload -U +X compinit && compinit
2408 +
2409 __gitcomp ()
2410 {
2411 emulate -L zsh