66f9fdabc1d08374c3eef212928f81ff32e2241e

Author
Felipe Contreras <felipe.contreras@gmail.com>
Committer
GitHub <noreply@github.com>
Date

Message

gitfast: improve command aliases (#9385)

So that compdefs with dashes work as well as underscores:

  compdef _git gc=git_commit

Or:

  compdef _git gc=git-commit

The official Zsh Git completion uses dashes, and this way people don't
have to change their existing definitions.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>

Diff

 1diff --git a/plugins/gitfast/_git b/plugins/gitfast/_git
 2index 46d10d6f93a2873174485252d857f76d545c0100..6ca63ed87b1078654adcc4fbd890ef0a98c1f05f 100644
 3--- a/plugins/gitfast/_git
 4+++ b/plugins/gitfast/_git
 5@@ -275,6 +275,8 @@ _git ()
 6 		emulate ksh -c __${service}_main
 7 	elif (( $+functions[_${service}] )); then
 8 		emulate ksh -c _${service}
 9+	elif ((	$+functions[_${service//-/_}] )); then
10+		emulate ksh -c _${service//-/_}
11 	fi
12 
13 	let _ret && _default && _ret=0