* [PATCH 2/4] Use tree_from_tree_or_commit() in read-tree.
@ 2005-04-20 6:09 Junio C Hamano
0 siblings, 0 replies; only message in thread
From: Junio C Hamano @ 2005-04-20 6:09 UTC (permalink / raw)
To: Linus Torvalds; +Cc: git
This patch makes read-tree accept either tree or commit.
Signed-off-by: Junio C Hamano <junkio@cox.net>
---
read-tree.c | 4 +---
1 files changed, 1 insertion(+), 3 deletions(-)
Makefile: needs update
--- a/read-tree.c
+++ b/read-tree.c
@@ -29,11 +29,9 @@ static int read_tree(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)
return -1;
- if (strcmp(type, "tree"))
- return -1;
while (size) {
int len = strlen(buffer)+1;
unsigned char *sha1 = buffer + len;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-04-20 6:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-20 6:09 [PATCH 2/4] Use tree_from_tree_or_commit() in read-tree Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox