| 11 | #include "tree.h" |
| 12 | |
| 13 | static void test_parse_commit_in_graph(const char *gitdir, const char *worktree, |
| 14 | const struct object_id *commit_oid) |
| 15 | { |
| 16 | struct repository r; |
| 17 | struct commit *c; |
| 18 | struct commit_list *parent; |
| 19 | |
| 20 | if (repo_init(&r, gitdir, worktree)) |
| 21 | die("Couldn't init repo"); |
| 22 | |
| 23 | repo_set_hash_algo(the_repository, hash_algo_by_ptr(r.hash_algo)); |
| 24 | |
| 25 | c = lookup_commit(&r, commit_oid); |
| 26 | |
| 27 | if (!parse_commit_in_graph(&r, c)) |
| 28 | die("Couldn't parse commit"); |
| 29 | |
| 30 | printf("%"PRItime, c->date); |
| 31 | for (parent = c->parents; parent; parent = parent->next) |
| 32 | printf(" %s", oid_to_hex(&parent->item->object.oid)); |
| 33 | printf("\n"); |
| 34 | |
| 35 | repo_clear(&r); |
| 36 | } |
| 37 | |
| 38 | static void test_get_commit_tree_in_graph(const char *gitdir, |
| 39 | const char *worktree, |
no test coverage detected