MCPcopy Create free account
hub / github.com/git/git / test_parse_commit_in_graph

Function test_parse_commit_in_graph

t/helper/test-repository.c:13–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11#include "tree.h"
12
13static 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
38static void test_get_commit_tree_in_graph(const char *gitdir,
39 const char *worktree,

Callers 1

cmd__repositoryFunction · 0.85

Calls 8

repo_initFunction · 0.85
repo_set_hash_algoFunction · 0.85
hash_algo_by_ptrFunction · 0.85
lookup_commitFunction · 0.85
parse_commit_in_graphFunction · 0.85
oid_to_hexFunction · 0.85
repo_clearFunction · 0.85
dieFunction · 0.50

Tested by

no test coverage detected