MCPcopy Index your code
hub / github.com/git/git / stdin_diff_trees

Function stdin_diff_trees

builtin/diff-tree.c:48–63  ·  view source on GitHub ↗

Diff two trees. */

Source from the content-addressed store, hash-verified

46
47/* Diff two trees. */
48static 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
65static int diff_tree_stdin(char *line)
66{

Callers 1

diff_tree_stdinFunction · 0.85

Calls 7

parse_oid_hexFunction · 0.85
errorFunction · 0.85
lookup_treeFunction · 0.85
repo_parse_treeFunction · 0.85
oid_to_hexFunction · 0.85
diff_tree_oidFunction · 0.85
log_tree_diff_flushFunction · 0.85

Tested by

no test coverage detected