summaryrefslogtreecommitdiff
path: root/src/commit_graph.h
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 /src/commit_graph.h
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 'src/commit_graph.h')
-rw-r--r--src/commit_graph.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/commit_graph.h b/src/commit_graph.h
index f3a431705..f21a03769 100644
--- a/src/commit_graph.h
+++ b/src/commit_graph.h
@@ -89,6 +89,14 @@ typedef struct git_commit_graph_entry {
} git_commit_graph_entry;
int git_commit_graph_open(git_commit_graph_file **cgraph_out, const char *path);
+
+/*
+ * Returns whether the commit_graph_file needs to be reloaded since the
+ * contents of the commit-graph file have changed on disk. If `path` is NULL,
+ * the filename stored in `cgraph` will be used.
+ */
+bool git_commit_graph_needs_refresh(const git_commit_graph_file *cgraph, const char *path);
+
int git_commit_graph_entry_find(
git_commit_graph_entry *e,
const git_commit_graph_file *cgraph,