ls-tree: remove path filtering logic in show_tree
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 <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
6a0b0b6de9
commit
1cf9952db2
21
quote.c
21
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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user