Diff two trees. */
| 46 | |
| 47 | /* Diff two trees. */ |
| 48 | static int stdin_diff_trees(struct tree *tree1, const char *p) |
| 49 | { |
| 50 | struct object_id oid; |
| 51 | struct tree *tree2; |
| 52 | if (!isspace(*p++) || parse_oid_hex(p, &oid, &p) || *p) |
| 53 | return error("Need exactly two trees, separated by a space"); |
| 54 | tree2 = lookup_tree(the_repository, &oid); |
| 55 | if (!tree2 || repo_parse_tree(the_repository, tree2)) |
| 56 | return -1; |
| 57 | printf("%s %s\n", oid_to_hex(&tree1->object.oid), |
| 58 | oid_to_hex(&tree2->object.oid)); |
| 59 | diff_tree_oid(&tree1->object.oid, &tree2->object.oid, |
| 60 | "", &log_tree_opt.diffopt); |
| 61 | log_tree_diff_flush(&log_tree_opt); |
| 62 | return 0; |
| 63 | } |
| 64 | |
| 65 | static int diff_tree_stdin(char *line) |
| 66 | { |
no test coverage detected