git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-completion.bash: update obsolete code.
@ 2012-12-16 21:50 Manlio Perillo
  2012-12-17  4:54 ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Manlio Perillo @ 2012-12-16 21:50 UTC (permalink / raw)
  To: git; +Cc: Manlio Perillo

The git-completion.bash script was using the git ls-tree command
without the --name-only option, with a sed filter to parse path names;
use the --name-only option, instead.

Signed-off-by: Manlio Perillo <manlio.perillo@gmail.com>
---
 contrib/completion/git-completion.bash | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 0b77eb1..85d9051 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -397,20 +397,7 @@ __git_complete_revlist_file ()
 		*)   pfx="$ref:$pfx" ;;
 		esac
 
-		__gitcomp_nl "$(git --git-dir="$(__gitdir)" ls-tree "$ls" \
-				| sed '/^100... blob /{
-				           s,^.*	,,
-				           s,$, ,
-				       }
-				       /^120000 blob /{
-				           s,^.*	,,
-				           s,$, ,
-				       }
-				       /^040000 tree /{
-				           s,^.*	,,
-				           s,$,/,
-				       }
-				       s/^.*	//')" \
+		__gitcomp_nl "$(git --git-dir="$(__gitdir)" ls-tree --name-only "$ls")" \
 			"$pfx" "$cur_" ""
 		;;
 	*...*)
-- 
1.8.1.rc1.18.g9db0d25

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

end of thread, other threads:[~2012-12-18  1:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-16 21:50 [PATCH] git-completion.bash: update obsolete code Manlio Perillo
2012-12-17  4:54 ` Junio C Hamano
2012-12-17 16:53   ` Manlio Perillo
2012-12-17 20:29     ` Junio C Hamano
2012-12-18  1:37     ` 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).