diff options
| author | Edward Thomson <ethomson@edwardthomson.com> | 2022-01-23 09:47:01 -0500 |
|---|---|---|
| committer | Edward Thomson <ethomson@edwardthomson.com> | 2022-06-20 17:05:29 -0400 |
| commit | 3fbf580c91935ccdea25a135204419991f503b63 (patch) | |
| tree | 53ec861796641faf8895a1f19444c1939ac6be9a /src/libgit2/commit_graph.c | |
| parent | 61838295a055c8c7a4a7eb730538c6e08a38dd6a (diff) | |
| download | libgit2-3fbf580c91935ccdea25a135204419991f503b63.tar.gz | |
oid: give oids a type
`git_oid`s now have a type, and we require the oid type when creating
the object id from creation functions.
Diffstat (limited to 'src/libgit2/commit_graph.c')
| -rw-r--r-- | src/libgit2/commit_graph.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libgit2/commit_graph.c b/src/libgit2/commit_graph.c index 7e98ffb27..2edf51a58 100644 --- a/src/libgit2/commit_graph.c +++ b/src/libgit2/commit_graph.c @@ -150,7 +150,7 @@ static int commit_graph_parse_oid_lookup( file->oid_lookup = oid = (unsigned char *)(data + chunk_oid_lookup->offset); prev_oid = zero_oid; for (i = 0; i < file->num_commits; ++i, oid += GIT_OID_SHA1_SIZE) { - if (git_oid_raw_cmp(prev_oid, oid) >= 0) + if (git_oid_raw_cmp(prev_oid, oid, GIT_OID_SHA1_SIZE) >= 0) return commit_graph_error("OID Lookup index is non-monotonic"); prev_oid = oid; } @@ -437,7 +437,7 @@ static int git_commit_graph_entry_get_byindex( } commit_data = file->commit_data + pos * (GIT_OID_SHA1_SIZE + 4 * sizeof(uint32_t)); - git_oid_fromraw(&e->tree_oid, commit_data); + git_oid_fromraw(&e->tree_oid, commit_data, GIT_OID_SHA1); e->parent_indices[0] = ntohl(*((uint32_t *)(commit_data + GIT_OID_SHA1_SIZE))); e->parent_indices[1] = ntohl( *((uint32_t *)(commit_data + GIT_OID_SHA1_SIZE + sizeof(uint32_t)))); @@ -471,7 +471,7 @@ static int git_commit_graph_entry_get_byindex( } } - git_oid_fromraw(&e->sha1, &file->oid_lookup[pos * GIT_OID_SHA1_SIZE]); + git_oid_fromraw(&e->sha1, &file->oid_lookup[pos * GIT_OID_SHA1_SIZE], GIT_OID_SHA1); return 0; } |
