summaryrefslogtreecommitdiff
path: root/pack-bitmap.c
diff options
context:
space:
mode:
authorKarthik Nayak <karthik.188@gmail.com>2024-11-27 17:28:32 +0100
committerJunio C Hamano <gitster@pobox.com>2024-12-04 10:32:21 +0900
commitf59de71cf700f9f8da27023ec8b5df117f99d9c8 (patch)
treed6fea036d096b6b92fb763df8697fb24f383d9f9 /pack-bitmap.c
parentd5c2ca576a47480b03a83821041955a21a645d1a (diff)
downloadgit-f59de71cf700f9f8da27023ec8b5df117f99d9c8.tar.xz
midx: pass down `hash_algo` to functions using global variables
The functions `get_split_midx_filename_ext()`, `get_midx_filename()` and `get_midx_filename_ext()` use `hash_to_hex()` which internally uses the `the_hash_algo` global variable. Remove this dependency on global variables by passing down the `hash_algo` through to the functions mentioned and instead calling `hash_to_hex_algop()` along with the obtained `hash_algo`. Signed-off-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pack-bitmap.c')
-rw-r--r--pack-bitmap.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/pack-bitmap.c b/pack-bitmap.c
index 0cb1b56c9d..7b62d099ca 100644
--- a/pack-bitmap.c
+++ b/pack-bitmap.c
@@ -375,8 +375,8 @@ static int load_bitmap_entries_v1(struct bitmap_index *index)
char *midx_bitmap_filename(struct multi_pack_index *midx)
{
struct strbuf buf = STRBUF_INIT;
- get_midx_filename_ext(&buf, midx->object_dir, get_midx_checksum(midx),
- MIDX_EXT_BITMAP);
+ get_midx_filename_ext(midx->repo->hash_algo, &buf, midx->object_dir,
+ get_midx_checksum(midx), MIDX_EXT_BITMAP);
return strbuf_detach(&buf, NULL);
}
@@ -415,7 +415,7 @@ static int open_midx_bitmap_1(struct bitmap_index *bitmap_git,
if (bitmap_git->pack || bitmap_git->midx) {
struct strbuf buf = STRBUF_INIT;
- get_midx_filename(&buf, midx->object_dir);
+ get_midx_filename(midx->repo->hash_algo, &buf, midx->object_dir);
trace2_data_string("bitmap", bitmap_repo(bitmap_git),
"ignoring extra midx bitmap file", buf.buf);
close(fd);