From 1cf9952db243c624cc2763fa74e98adbb38537b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Sun, 30 Nov 2014 16:05:01 +0700 Subject: ls-tree: remove path filtering logic in show_tree MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ls-tree uses read_tree_recursive() which already does path filtering using pathspec. No need to filter one more time based on prefix only. "ls-tree ../somewhere" does not work because of this. write_name_quotedpfx() can now be retired because nobody else uses it. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- quote.c | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'quote.c') diff --git a/quote.c b/quote.c index 45e3db12d5..7920e18e44 100644 --- a/quote.c +++ b/quote.c @@ -274,27 +274,6 @@ void write_name_quoted(const char *name, FILE *fp, int terminator) fputc(terminator, fp); } -void write_name_quotedpfx(const char *pfx, size_t pfxlen, - const char *name, FILE *fp, int terminator) -{ - int needquote = 0; - - if (terminator) { - needquote = next_quote_pos(pfx, pfxlen) < pfxlen - || name[next_quote_pos(name, -1)]; - } - if (needquote) { - fputc('"', fp); - quote_c_style_counted(pfx, pfxlen, NULL, fp, 1); - quote_c_style(name, NULL, fp, 1); - fputc('"', fp); - } else { - fwrite(pfx, pfxlen, 1, fp); - fputs(name, fp); - } - fputc(terminator, fp); -} - void write_name_quoted_relative(const char *name, const char *prefix, FILE *fp, int terminator) { -- cgit v1.2.3