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

Function stdin_diff_commit

builtin/diff-tree.c:26–45  ·  view source on GitHub ↗

Diff one or more commits. */

Source from the content-addressed store, hash-verified

24
25/* Diff one or more commits. */
26static int stdin_diff_commit(struct commit *commit, const char *p)
27{
28 struct object_id oid;
29 struct commit_list **pptr = NULL;
30
31 /* Graft the fake parents locally to the commit */
32 while (isspace(*p++) && !parse_oid_hex(p, &oid, &p)) {
33 struct commit *parent = lookup_commit(the_repository, &oid);
34 if (!pptr) {
35 /* Free the real parent list */
36 commit_list_free(commit->parents);
37 commit->parents = NULL;
38 pptr = &(commit->parents);
39 }
40 if (parent) {
41 pptr = &commit_list_insert(parent, pptr)->next;
42 }
43 }
44 return log_tree_commit(&log_tree_opt, commit);
45}
46
47/* Diff two trees. */
48static int stdin_diff_trees(struct tree *tree1, const char *p)

Callers 1

diff_tree_stdinFunction · 0.85

Calls 5

parse_oid_hexFunction · 0.85
lookup_commitFunction · 0.85
commit_list_freeFunction · 0.85
commit_list_insertFunction · 0.85
log_tree_commitFunction · 0.85

Tested by

no test coverage detected