Skip to content

Commit

Permalink
completion: simplify __git_complete_revlist_file
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Felipe Contreras authored and Junio C Hamano committed May 7, 2012
1 parent edf1412 commit 41e6229
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions contrib/completion/git-completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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,$, ,
Expand All @@ -692,7 +690,7 @@ __git_complete_revlist_file ()
s,$,/,
}
s/^.* //')" \
-- "$cur_"))
"$pfx" "$cur_" ""
;;
*...*)
pfx="${cur_%...*}..."
Expand Down

0 comments on commit 41e6229

Please sign in to comment.