Eliminated zsh references in completion

Since there is another, totally different completion function, this patch eliminates
all references to zsh in _git_index_tab_completion.
This commit is contained in:
Aljaž "g5pw" Srebrnič
2012-10-30 11:19:24 +01:00
parent a9aa363fdb
commit 4dec6b288f

View File

@@ -301,13 +301,11 @@ if [ $shell = 'bash' ]; then
COMPREPLY=($(compgen -d "$base_path$search_path" | \grep -v "/.git" | sed -e "s:$base_path:$project:" -e "s:$:/:" ))
# If curr string starts with /, tab complete top-level directories in root project dir
elif ([ $shell = "bash" ] && [ "${curw:0:1}" = "/" ]) || \
([ $shell = "zsh" ] && [ "${curw[1,1]}" = "/" ]); then
elif [ "${curw:0:1}" = "/" ]; then
COMPREPLY=($(compgen -d "$GIT_REPO_DIR$curw" | sed -e "s:$GIT_REPO_DIR/::" -e "s:^:/:"))
# If curr string starts with --, tab complete commands
elif ([ $shell = "bash" ] && [ "${curw:0:2}" = "--" ]) || \
([ $shell = "zsh" ] && [ "${curw[1,2]}" = "--" ]); then
elif [ "${curw:0:2}" = "--" ]; then
local commands="--list\n--rebuild\n--update-all\n--batch-cmd\n--count-by-host"
COMPREPLY=($(compgen -W '$(echo -e "\n"$commands)' -- $curw))