summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-11-28 10:30:04 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-11-29 07:03:12 (GMT)
commit32b5904b5f94829aa7ae11b585ca9c639d57cc74 (patch)
treea795ef80aec0e5c329a7becaf9bbf110628f07a1
parente2466376ec9a8508b4c8ba2b0c29945c5bfc6cc2 (diff)
downloadgit-32b5904b5f94829aa7ae11b585ca9c639d57cc74.zip
git-32b5904b5f94829aa7ae11b585ca9c639d57cc74.tar.gz
git-32b5904b5f94829aa7ae11b585ca9c639d57cc74.tar.bz2
ls-tree: Resurrect funny name quoting lost during rewrite.
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>
-rw-r--r--ls-tree.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ls-tree.c b/ls-tree.c
index 4df5830..d4b6219 100644
--- a/ls-tree.c
+++ b/ls-tree.c
@@ -48,7 +48,9 @@ static int show_tree(unsigned char *sha1, const char *base, int baselen, const c
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));
+ write_name_quoted(base, baselen, pathname, line_termination, stdout);
+ putchar(line_termination);
return 0;
}