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

Function diff_tree_stdin

builtin/diff-tree.c:65–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65static int diff_tree_stdin(char *line)
66{
67 int len = strlen(line);
68 struct object_id oid;
69 struct object *obj;
70 const char *p;
71
72 if (!len || line[len-1] != '\n')
73 return -1;
74 line[len-1] = 0;
75 if (parse_oid_hex(line, &oid, &p))
76 return -1;
77 obj = parse_object(the_repository, &oid);
78 if (!obj)
79 return -1;
80 if (obj->type == OBJ_COMMIT)
81 return stdin_diff_commit((struct commit *)obj, p);
82 if (obj->type == OBJ_TREE)
83 return stdin_diff_trees((struct tree *)obj, p);
84 error("Object %s is a %s, not a commit or tree",
85 oid_to_hex(&oid), type_name(obj->type));
86 return -1;
87}
88
89static const char diff_tree_usage[] =
90"git diff-tree [--stdin] [-m] [-s] [-v] [--no-commit-id] [--pretty]\n"

Callers 1

cmd_diff_treeFunction · 0.85

Calls 7

parse_oid_hexFunction · 0.85
parse_objectFunction · 0.85
stdin_diff_commitFunction · 0.85
stdin_diff_treesFunction · 0.85
errorFunction · 0.85
oid_to_hexFunction · 0.85
type_nameFunction · 0.85

Tested by

no test coverage detected