const unsigned char *sha1 = tree_entry_extract(desc, &path, &mode);
if (opt->recursive && S_ISDIR(mode)) {
- char type[20];
+ enum object_type type;
char *newbase = malloc_base(base, path, strlen(path));
struct tree_desc inner;
void *tree;
- tree = read_sha1_file(sha1, type, &inner.size);
- if (!tree || strcmp(type, tree_type))
+ tree = read_sha1_file(sha1, &type, &inner.size);
+ if (!tree || type != OBJ_TREE)
die("corrupt tree sha %s", sha1_to_hex(sha1));
inner.buf = tree;
int diff_tree(struct tree_desc *t1, struct tree_desc *t2, const char *base, struct diff_options *opt)
{
while (t1->size | t2->size) {
+ if (opt->quiet && opt->has_changes)
+ break;
if (opt->nr_paths && t1->size && !interesting(t1, base, opt)) {
update_tree_entry(t1);
continue;