diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/graph/commit_graph.c | 20 | ||||
-rw-r--r-- | tests/resources/testrepo.git/objects/info/commit-graph | bin | 0 -> 1940 bytes |
2 files changed, 20 insertions, 0 deletions
diff --git a/tests/graph/commit_graph.c b/tests/graph/commit_graph.c new file mode 100644 index 000000000..329aa5b00 --- /dev/null +++ b/tests/graph/commit_graph.c @@ -0,0 +1,20 @@ +#include "clar_libgit2.h" + +#include <git2.h> + +#include "commit_graph.h" + +void test_graph_commit_graph__parse(void) +{ + git_repository *repo; + struct git_commit_graph_file *cgraph; + git_buf commit_graph_path = GIT_BUF_INIT; + + cl_git_pass(git_repository_open(&repo, cl_fixture("testrepo.git"))); + cl_git_pass(git_buf_joinpath(&commit_graph_path, git_repository_path(repo), "objects/info/commit-graph")); + cl_git_pass(git_commit_graph_open(&cgraph, git_buf_cstr(&commit_graph_path))); + + git_commit_graph_free(cgraph); + git_repository_free(repo); + git_buf_dispose(&commit_graph_path); +} diff --git a/tests/resources/testrepo.git/objects/info/commit-graph b/tests/resources/testrepo.git/objects/info/commit-graph Binary files differnew file mode 100644 index 000000000..2ef31d83e --- /dev/null +++ b/tests/resources/testrepo.git/objects/info/commit-graph |