Diff one or more commits. */
| 24 | |
| 25 | /* Diff one or more commits. */ |
| 26 | static 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. */ |
| 48 | static int stdin_diff_trees(struct tree *tree1, const char *p) |
no test coverage detected