Skip to content

Commit 41e6229

Browse files
Felipe Contrerasgitster
authored andcommitted
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>
1 parent edf1412 commit 41e6229

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

contrib/completion/git-completion.bash

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -676,9 +676,7 @@ __git_complete_revlist_file ()
676676
*) pfx="$ref:$pfx" ;;
677677
esac
678678

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" \
682680
| sed '/^100... blob /{
683681
s,^.* ,,
684682
s,$, ,
@@ -692,7 +690,7 @@ __git_complete_revlist_file ()
692690
s,$,/,
693691
}
694692
s/^.* //')" \
695-
-- "$cur_"))
693+
"$pfx" "$cur_" ""
696694
;;
697695
*...*)
698696
pfx="${cur_%...*}..."

0 commit comments

Comments
 (0)