[PATCH 12/12] completion: rename _git and _gitk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Would be helpful to reuse these for zsh completion; it uses _git, and it
cannot be changed.

Signed-off-by: Felipe Contreras <felipe.contreras@xxxxxxxxx>
---
 contrib/completion/git-completion.bash |    8 ++++----
 t/t9902-completion.sh                  |    2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 6cf1d98..7d663f7 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -2612,7 +2612,7 @@ _git_whatchanged ()
 	_git_log
 }
 
-_git ()
+_main_git ()
 {
 	local i c=1 cmd cmd_pos __git_dir
 
@@ -2666,7 +2666,7 @@ _git ()
 	fi
 }
 
-_gitk ()
+_main_gitk ()
 {
 	__git_has_doubledash && return
 
@@ -2710,7 +2710,7 @@ foo_wrap ()
 
 git_complete ()
 {
-	local name="${2-$1}"
+	local name="${2-main_$1}"
 	local cmd="${name#git_}"
 	eval "$(typeset -f foo_wrap | sed -e "s/foo_cmd/$cmd/" -e "s/foo/_$name/")"
 	complete -o bashdefault -o default -o nospace -F _${name}_wrap $1 2>/dev/null \
@@ -2725,5 +2725,5 @@ git_complete gitk
 # included the '.exe' suffix.
 #
 if [ Cygwin = "$(uname -o 2>/dev/null)" ]; then
-git_complete git.exe git
+git_complete git.exe main_git
 fi
diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
index 6c61e7a..ef1323f 100755
--- a/t/t9902-completion.sh
+++ b/t/t9902-completion.sh
@@ -57,7 +57,7 @@ test_completion ()
 	local _cword wrap
 	_words=( $1 )
 	test $# -gt 1 && echo "$2" > expected
-	wrap="${3-_git_wrap}"
+	wrap="${3-_main_git_wrap}"
 	(( _cword = ${#_words[@]} - 1 ))
 	$wrap && print_comp &&
 	test_cmp expected out
-- 
1.7.10.3.g5a738d

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]