summaryrefslogtreecommitdiff
path: root/tests/graph/commit_graph.c
diff options
context:
space:
mode:
authorlhchavez <lhchavez@lhchavez.com>2021-01-05 06:24:26 -0800
committerlhchavez <lhchavez@lhchavez.com>2021-01-10 11:18:38 -0800
commit1a2f960907ebeeb703c85c5d2b61de8dbd69a1b5 (patch)
treef6e58d86a36d986d07d7e837676294147a69b3a2 /tests/graph/commit_graph.c
parent1f32ed25ee6f5ead60fff8cf5ba544ef2d567fe0 (diff)
downloadlibgit2-1a2f960907ebeeb703c85c5d2b61de8dbd69a1b5.tar.gz
commit-graph: Introduce `git_commit_graph_needs_refresh()`
This change introduces a function that allows the caller to know whether the `commit-graph` file has not been modified since it was parsed. Part of: #5757
Diffstat (limited to 'tests/graph/commit_graph.c')
-rw-r--r--tests/graph/commit_graph.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/graph/commit_graph.c b/tests/graph/commit_graph.c
index 43f566796..4c7c5a726 100644
--- a/tests/graph/commit_graph.c
+++ b/tests/graph/commit_graph.c
@@ -15,6 +15,7 @@ void test_graph_commit_graph__parse(void)
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)));
+ cl_assert_equal_i(git_commit_graph_needs_refresh(cgraph, git_buf_cstr(&commit_graph_path)), 0);
cl_git_pass(git_oid_fromstr(&id, "5001298e0c09ad9c34e4249bc5801c75e9754fa5"));
cl_git_pass(git_commit_graph_entry_find(&e, cgraph, &id, GIT_OID_HEXSZ));