summaryrefslogtreecommitdiff
path: root/src/libgit2/commit_graph.h
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2023-04-22 23:12:00 +0100
committerEdward Thomson <ethomson@edwardthomson.com>2023-04-22 23:17:32 +0100
commit190a4c55df72b32adf4d60f77cbc47276b74f84b (patch)
tree896d6d41c2ea6305992bd646bbbe79a3fdb5f6fe /src/libgit2/commit_graph.h
parente288f874a3a73ef31f88bb524f6d25d5ff3c5a3a (diff)
parent8a62616f43fe5ea37d41296f40293ff97aa88cfa (diff)
downloadlibgit2-190a4c55df72b32adf4d60f77cbc47276b74f84b.tar.gz
Merge remote-tracking branch 'origin/main' into shallow-clone-network
Diffstat (limited to 'src/libgit2/commit_graph.h')
-rw-r--r--src/libgit2/commit_graph.h24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/libgit2/commit_graph.h b/src/libgit2/commit_graph.h
index 517abb239..ecf4379bd 100644
--- a/src/libgit2/commit_graph.h
+++ b/src/libgit2/commit_graph.h
@@ -30,6 +30,9 @@
typedef struct git_commit_graph_file {
git_map graph_map;
+ /* The type of object IDs in the commit graph file. */
+ git_oid_t oid_type;
+
/* The OID Fanout table. */
const uint32_t *oid_fanout;
/* The total number of commits in the graph. */
@@ -84,10 +87,10 @@ typedef struct git_commit_graph_entry {
/* The index within the Extra Edge List of any parent after the first two. */
size_t extra_parents_index;
- /* The SHA-1 hash of the root tree of the commit. */
+ /* The object ID of the root tree of the commit. */
git_oid tree_oid;
- /* The SHA-1 hash of the requested commit. */
+ /* The object ID hash of the requested commit. */
git_oid sha1;
} git_commit_graph_entry;
@@ -99,18 +102,28 @@ struct git_commit_graph {
/* The underlying commit-graph file. */
git_commit_graph_file *file;
+ /* The object ID types in the commit graph. */
+ git_oid_t oid_type;
+
/* Whether the commit-graph file was already checked for validity. */
bool checked;
};
/** Create a new commit-graph, optionally opening the underlying file. */
-int git_commit_graph_new(git_commit_graph **cgraph_out, const char *objects_dir, bool open_file);
+int git_commit_graph_new(
+ git_commit_graph **cgraph_out,
+ const char *objects_dir,
+ bool open_file,
+ git_oid_t oid_type);
/** Validate the checksum of a commit graph */
int git_commit_graph_validate(git_commit_graph *cgraph);
/** Open and validate a commit-graph file. */
-int git_commit_graph_file_open(git_commit_graph_file **file_out, const char *path);
+int git_commit_graph_file_open(
+ git_commit_graph_file **file_out,
+ const char *path,
+ git_oid_t oid_type);
/*
* Attempt to get the git_commit_graph's commit-graph file. This object is
@@ -134,6 +147,9 @@ struct git_commit_graph_writer {
*/
git_str objects_info_dir;
+ /* The object ID type of the commit graph. */
+ git_oid_t oid_type;
+
/* The list of packed commits. */
git_vector commits;
};