X-Git-Url: https://git.uis.cam.ac.uk/x/uis/git/git.git/blobdiff_plain/df8436622fb553f468180b61032fe34bd6712752..21666f1aae4e890d8f50924f9e80763b27e6a45d:/tree-diff.c diff --git a/tree-diff.c b/tree-diff.c index 37d235e06e..c8275823d0 100644 --- a/tree-diff.c +++ b/tree-diff.c @@ -139,13 +139,13 @@ static void show_entry(struct diff_options *opt, const char *prefix, struct tree 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;