[PATCH] ls-tree: Resurrect funny name quoting lost during rewrite.
- From
Junio C Hamano <junkio@cox.net>
- Date
- Nov 28, 2005, 10:51 UTC
- Message-ID
- <7vwtitujso.fsf_-_@assigned-by-dhcp.cox.net>
- In-Reply-To
- <Pine.LNX.4.64.0511272219420.13959@g5.osdl.org>
The rewrite to match ls-files/diff-tree behaviour accidentally lost the name quoting. I am not proud about this code, but this would get the test going.
Signed-off-by: Junio C Hamano <junkio@cox.net>
---
ls-tree.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-)
applies-to: 4db95789ce3af40091ead2a97a72e75f9a0b8384 e7cdcbbbbd2fd2848244f998a0b92338fc68fe78
diff --git a/ls-tree.c b/ls-tree.c index 4df5830..df3bcec 100644 --- a/ls-tree.c +++ b/ls-tree.c @@ -48,7 +48,15 @@ static int show_tree(unsigned char *sha1 type = "tree"; } - printf("%06o %s %s\t%.*s%s%c", mode, type, sha1_to_hex(sha1), baselen, base, pathname, line_termination); + printf("%06o %s %s\t", mode, type, sha1_to_hex(sha1)); + if (1) { + /* NEEDSWORK: */ + char base_[baselen + 1]; + memcpy(base_, base, baselen); + base_[baselen] = 0; + write_name_quoted(base_, pathname, line_termination, stdout); + } + putchar(line_termination); return 0; } --- 0.99.9.GIT