diff options
Diffstat (limited to 'commit-graph.h')
-rw-r--r-- | commit-graph.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/commit-graph.h b/commit-graph.h index 25cdec127a..37faee6b66 100644 --- a/commit-graph.h +++ b/commit-graph.h @@ -41,6 +41,21 @@ int open_commit_graph(const char *graph_file, int *fd, struct stat *st); int parse_commit_in_graph(struct repository *r, struct commit *item); /* + * Fills `*pos` with the graph position of `c`, and returns 1 if `c` is + * found in the commit-graph belonging to `r`, or 0 otherwise. + * Initializes the commit-graph belonging to `r` if it hasn't been + * already. + * + * Note: this is a low-level helper that does not alter any slab data + * associated with `c`. Useful in circumstances where the slab data is + * already being modified (e.g., writing the commit-graph itself). + * + * In most cases, callers should use `parse_commit_in_graph()` instead. + */ +int repo_find_commit_pos_in_graph(struct repository *r, struct commit *c, + uint32_t *pos); + +/* * Look up the given commit ID in the commit-graph. This will only return a * commit if the ID exists both in the graph and in the object database such * that we don't return commits whose object has been pruned. Otherwise, this |