summaryrefslogtreecommitdiff
path: root/src/libgit2/odb_pack.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2022-01-22 23:10:03 -0500
committerEdward Thomson <ethomson@edwardthomson.com>2022-06-14 22:29:57 -0400
commitdbc4ac1c76827e954e0aa27afe8bb7e0b8993a93 (patch)
tree56f18a11bca8d17490a176cddf9e3756c2cebe91 /src/libgit2/odb_pack.c
parentf98dd5438f8d7bfd557b612fdf1605b1c3fb8eaf (diff)
downloadlibgit2-dbc4ac1c76827e954e0aa27afe8bb7e0b8993a93.tar.gz
oid: `GIT_OID_*SZ` is now `GIT_OID_SHA1_*SIZE`
In preparation for SHA256 support, `GIT_OID_RAWSZ` and `GIT_OID_HEXSZ` need to indicate that they're the size of _SHA1_ OIDs.
Diffstat (limited to 'src/libgit2/odb_pack.c')
-rw-r--r--src/libgit2/odb_pack.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libgit2/odb_pack.c b/src/libgit2/odb_pack.c
index 818cc6125..2401e9578 100644
--- a/src/libgit2/odb_pack.c
+++ b/src/libgit2/odb_pack.c
@@ -177,7 +177,7 @@ static int pack_entry_find(struct git_pack_entry *e,
* a prefix of an identifier.
* Sets GIT_EAMBIGUOUS if short oid is ambiguous.
* This method assumes that len is between
- * GIT_OID_MINPREFIXLEN and GIT_OID_HEXSZ.
+ * GIT_OID_MINPREFIXLEN and GIT_OID_SHA1_HEXSIZE.
*/
static int pack_entry_find_prefix(
struct git_pack_entry *e,
@@ -273,7 +273,7 @@ static int pack_entry_find(struct git_pack_entry *e, struct pack_backend *backen
size_t i;
if (backend->midx &&
- git_midx_entry_find(&midx_entry, backend->midx, oid, GIT_OID_HEXSZ) == 0 &&
+ git_midx_entry_find(&midx_entry, backend->midx, oid, GIT_OID_SHA1_HEXSIZE) == 0 &&
midx_entry.pack_index < git_vector_length(&backend->midx_packs)) {
e->offset = midx_entry.offset;
git_oid_cpy(&e->sha1, &midx_entry.sha1);
@@ -282,21 +282,21 @@ static int pack_entry_find(struct git_pack_entry *e, struct pack_backend *backen
}
if (last_found &&
- git_pack_entry_find(e, last_found, oid, GIT_OID_HEXSZ) == 0)
+ git_pack_entry_find(e, last_found, oid, GIT_OID_SHA1_HEXSIZE) == 0)
return 0;
git_vector_foreach(&backend->packs, i, p) {
if (p == last_found)
continue;
- if (git_pack_entry_find(e, p, oid, GIT_OID_HEXSZ) == 0) {
+ if (git_pack_entry_find(e, p, oid, GIT_OID_SHA1_HEXSIZE) == 0) {
backend->last_found = p;
return 0;
}
}
return git_odb__error_notfound(
- "failed to find pack entry", oid, GIT_OID_HEXSZ);
+ "failed to find pack entry", oid, GIT_OID_SHA1_HEXSIZE);
}
static int pack_entry_find_prefix(
@@ -605,7 +605,7 @@ static int pack_backend__read_prefix(
if (len < GIT_OID_MINPREFIXLEN)
error = git_odb__error_ambiguous("prefix length too short");
- else if (len >= GIT_OID_HEXSZ) {
+ else if (len >= GIT_OID_SHA1_HEXSIZE) {
/* We can fall back to regular read method */
error = pack_backend__read(buffer_p, len_p, type_p, backend, short_oid);
if (!error)