aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaylor Blau <me@ttaylorr.com>2026-02-24 13:59:34 -0500
committerJunio C Hamano <gitster@pobox.com>2026-02-24 11:16:31 -0800
commit00c0d84e6f0cdb91b0f261e12ed058ad3baa49bf (patch)
treeab9945dbfbdf032ae1928d5f2239eb4fcc0bfb19
parent7c02d39fc2ed2702223c7674f73150d9a7e61ba4 (diff)
downloadgit-00c0d84e6f0cdb91b0f261e12ed058ad3baa49bf.tar.xz
midx: mark `get_midx_checksum()` arguments as const
To make clear that the function `get_midx_checksum()` does not do anything to modify its argument, mark the MIDX pointer as const. The following commit will rename this function altogether to make clear that it returns the raw bytes of the checksum, not a hex-encoded copy of it. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--midx.c2
-rw-r--r--midx.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/midx.c b/midx.c
index a75ea99a0d..2a6b18954c 100644
--- a/midx.c
+++ b/midx.c
@@ -24,7 +24,7 @@ void clear_incremental_midx_files_ext(struct odb_source *source, const char *ext
int cmp_idx_or_pack_name(const char *idx_or_pack_name,
const char *idx_name);
-const unsigned char *get_midx_checksum(struct multi_pack_index *m)
+const unsigned char *get_midx_checksum(const struct multi_pack_index *m)
{
return m->data + m->data_len - m->source->odb->repo->hash_algo->rawsz;
}
diff --git a/midx.h b/midx.h
index 6e54d73503..7c7e0b5912 100644
--- a/midx.h
+++ b/midx.h
@@ -85,7 +85,7 @@ struct multi_pack_index {
#define MIDX_EXT_BITMAP "bitmap"
#define MIDX_EXT_MIDX "midx"
-const unsigned char *get_midx_checksum(struct multi_pack_index *m);
+const unsigned char *get_midx_checksum(const struct multi_pack_index *m);
void get_midx_filename(struct odb_source *source, struct strbuf *out);
void get_midx_filename_ext(struct odb_source *source, struct strbuf *out,
const unsigned char *hash, const char *ext);