git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] completion: simplify __git_complete_revlist_file
@ 2012-05-01 18:42 Felipe Contreras
  2012-05-01 23:39 ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: Felipe Contreras @ 2012-05-01 18:42 UTC (permalink / raw)
  To: git; +Cc: SZEDER Gábor, Felipe Contreras

Use new __gitcomp_nl; this is the last place that uses COMPREPLY and
compgen directly.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 contrib/completion/git-completion.bash |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 31f714d..d877a23 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_%...*}..."
-- 
1.7.10

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-05-07 17:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-01 18:42 [PATCH] completion: simplify __git_complete_revlist_file Felipe Contreras
2012-05-01 23:39 ` Junio C Hamano
2012-05-01 23:46   ` Felipe Contreras
2012-05-05 15:19     ` Felipe Contreras
2012-05-05 22:40     ` SZEDER Gábor
2012-05-07 17:15     ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).