threads / patch / 165

patch, 4 partsUse tree_from_tree_or_commit() in ls-tree.

Subject: [PATCH 4/4] Use tree_from_tree_or_commit() in ls-tree.

## tl;dr

One message between Apr 20, 2005 and Apr 20, 2005. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Junio C Hamano· Apr 20, 2005, 06:11 UTC · lore
This patch makes ls-tree accept either tree or commit.
Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 ls-tree.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
Makefile: needs update
cache.h: needs update
sha1_file.c: needs update
Show changes to ls-tree.c +1 −1
--- a/ls-tree.c
+++ b/ls-tree.c
@@ -74,7 +74,7 @@ static int list(unsigned char *sha1)
 	unsigned long size;
 	char type[20];
 
-	buffer = read_sha1_file(sha1, type, &size);
+	buffer = tree_from_tree_or_commit(sha1, type, &size);
 	if (!buffer)
 		die("unable to read sha1 file");
 	list_recursive(buffer, type, size, NULL);

← back to recent threads