Signed-off-by: Andy Parkins <redacted>
---
builtin-cat-file.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/builtin-cat-file.c b/builtin-cat-file.c
index 6c16bfa..e7997ee 100644
--- a/builtin-cat-file.c
+++ b/builtin-cat-file.c
@@ -121,12 +121,16 @@ int cmd_cat_file(int argc, const char **argv, const char *prefix)
die("Not a valid object name %s", argv[2]);
/* custom pretty-print here */
+ /* Special print tree types using ls-tree
+ * git-ls-tree argv[1] */
if (!strcmp(type, tree_type))
return cmd_ls_tree(2, argv + 1, NULL);
+ /* For everything else, read the object itself */
buf = read_sha1_file(sha1, type, &size);
if (!buf)
die("Cannot read object %s", argv[2]);
+ /* if the object is a tag, use pprint_tag() above */
if (!strcmp(type, tag_type)) {
pprint_tag(sha1, buf, size);
return 0;--
1.4.4.1.geeee8