diff options
author | Felipe Contreras <felipe.contreras@gmail.com> | 2012-05-01 20:42:56 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-05-07 10:15:41 -0700 |
commit | 41e6229db4abaf08ca277115f9ac800cdc7591d6 (patch) | |
tree | 12241d36f62a3aa7e0a1c21d860d4d25f88e8286 /contrib | |
parent | edf141218e4e4ecca3a8ab0c8fa9eafe381b3838 (diff) | |
download | git-41e6229db4abaf08ca277115f9ac800cdc7591d6.tar.gz |
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 <felipe.contreras@gmail.com>
Acked-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/completion/git-completion.bash | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 31f714da92..d877a2315c 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_%...*}..." |