- die("diff-tree: internal error");
- }
- return 0;
-}
-
-static int diff_tree_sha1(const unsigned char *old, const unsigned char *new, const char *base)
-{
- void *tree1, *tree2;
- unsigned long size1, size2;
- int retval;
-
- tree1 = read_tree_with_tree_or_commit_sha1(old, &size1, 0);
- if (!tree1)
- die("unable to read source tree (%s)", sha1_to_hex(old));
- tree2 = read_tree_with_tree_or_commit_sha1(new, &size2, 0);
- if (!tree2)
- die("unable to read destination tree (%s)", sha1_to_hex(new));
- retval = diff_tree(tree1, size1, tree2, size2, base);
- free(tree1);
- free(tree2);
- return retval;
-}
-
-static char *diff_tree_usage = "diff-tree [-r] [-z] <tree sha1> <tree sha1>";
-
-int main(int argc, char **argv)
-{
- unsigned char old[20], new[20];
-
- for (;;) {
- char *arg = argv[1];
-
- if (!arg || *arg != '-')
- break;
-
- argv++;
- argc--;
- if (!strcmp(arg, "-r")) {
- recursive = 1;