git: duplicate bash completion for zsh.

Should be a bit more robust than the previous method.

References #16992.