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>
This commit is contained in:
parent
edf141218e
commit
41e6229db4
@ -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_%...*}..."
|
||||
|
Loading…
Reference in New Issue
Block a user