From 2448f0f7aaf1cbb6bcaa5857f33ff893541ee1ff Mon Sep 17 00:00:00 2001 From: Clint Adams Date: Sun, 9 Mar 2008 12:16:54 +0000 Subject: 24701: use $service instead of $words[1] so completion will work if git is an alias to a wrapper. --- ChangeLog | 5 +++++ Completion/Unix/Command/_git | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 70ee0fedb..86148a574 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-03-09 Clint Adams + + * 24701: Completion/Unix/Command/_git: use $service instead of + $words[1] so completion will work if git is an alias to a wrapper. + 2008-03-08 Peter Stephenson * 24699: Src/hist.c, Src/input.c, Src/lex.c, diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index c597d94f3..d15f3599e 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -4138,7 +4138,7 @@ __git_is_indexed () { unset tmpwords fi - if [[ $words[1] == git ]]; then + if [[ $service == git ]]; then local state line declare -A opt_args _arguments -C \ @@ -4155,12 +4155,12 @@ __git_is_indexed () { __git_aliases_and_commands ;; (options) - curcontext="${curcontext%:*:*}:git-$words[1]:" - _call_function ret _git-$words[1] + curcontext="${curcontext%:*:*}:git-$service:" + _call_function ret _git-$service ;; esac else - _call_function ret _$words[1] + _call_function ret _$service fi } -- cgit 1.4.1