From: Felipe Contreras Date: Tue, 1 May 2012 18:42:56 +0000 (+0200) Subject: completion: simplify __git_complete_revlist_file X-Git-Tag: v1.7.11-rc0~30^2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=41e6229db4abaf08ca277115f9ac800cdc7591d6;p=git.git completion: simplify __git_complete_revlist_file Use new __gitcomp_nl; this is the last place that uses COMPREPLY and compgen directly outside __gitcomp* functions. Signed-off-by: Felipe Contreras Acked-by: SZEDER Gábor Signed-off-by: Junio C Hamano --- diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 31f714da9..d877a2315 100755 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -676,9 +676,7 @@ __git_complete_revlist_file () *) pfx="$ref:$pfx" ;; esac - local IFS=$'\n' - COMPREPLY=($(compgen -P "$pfx" \ - -W "$(git --git-dir="$(__gitdir)" ls-tree "$ls" \ + __gitcomp_nl "$(git --git-dir="$(__gitdir)" ls-tree "$ls" \ | sed '/^100... blob /{ s,^.* ,, s,$, , @@ -692,7 +690,7 @@ __git_complete_revlist_file () s,$,/, } s/^.* //')" \ - -- "$cur_")) + "$pfx" "$cur_" "" ;; *...*) pfx="${cur_%...*}..."