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>

Felipe Contreras committed May 1, 2012 at 20:42 UTC 41e6229db4abaf08ca277115f9ac800cdc7591d6
1 file changed +2 -4
contrib/completion/git-completion.bash
+2 -4
@@ -676,9 +676,7 @@ __git_complete_revlist_file ()
676 *) pfx="$ref:$pfx" ;;
677 esac
678
679 - local IFS=$'\n'
680 - COMPREPLY=($(compgen -P "$pfx" \
681 - -W "$(git --git-dir="$(__gitdir)" ls-tree "$ls" \
679 + __gitcomp_nl "$(git --git-dir="$(__gitdir)" ls-tree "$ls" \
680 | sed '/^100... blob /{
681 s,^.* ,,
682 s,$, ,
@@ -692,7 +690,7 @@ __git_complete_revlist_file ()
690 s,$,/,
691 }
692 s/^.* //')" \
695 - -- "$cur_"))
693 + "$pfx" "$cur_" ""
694 ;;
695 *...*)
696 pfx="${cur_%...*}..."