completion: zsh: fix for command aliasing
authorFelipe Contreras <felipe.contreras@gmail.com>
Wed, 28 Oct 2020 02:06:51 +0000 (20:06 -0600)
committerJunio C Hamano <gitster@pobox.com>
Wed, 28 Oct 2020 21:30:59 +0000 (14:30 -0700)
commit81f717bb268e86eee5701b8199d8f030938a184c
treecfd2719d1c84218b66d893ed6481975f2c9852c1
parentea625a39fe5dfcaa3df0d1ee53a40008213acd59
completion: zsh: fix for command aliasing

A lot of people want to define aliases like gc='git commit', and zsh
allows that (when not using 'complete_aliases'), but we need to handle
services that call a function other than the main one.

With this patch we can do:

  compdef _git gc=git_commit

Additionally, add compatibility for Zsh Git functions which have the
form git-commit (with dash, not underscore).

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