diff options
| author | Patrick Steinhardt <ps@pks.im> | 2025-08-11 15:46:50 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-08-11 09:22:23 -0700 |
| commit | 13296ac909d53e14712f89a7f4fda94dd0465479 (patch) | |
| tree | 0ca43ab7ad9f727138d421f93694fd46e9710386 /pack-bitmap.c | |
| parent | 7744936f374308d6fa3c6e317fb8fe0b685d0ef2 (diff) | |
| download | git-13296ac909d53e14712f89a7f4fda94dd0465479.tar.xz | |
midx: compute paths via their source
With the preceding commits we started to always have the object database
source available when we load, write or access multi-pack indices. With
this in place we can change how MIDX paths are computed so that we don't
have to pass in the combination of a hash algorithm and object directory
anymore, but only the object database source.
Refactor the code accordingly.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pack-bitmap.c')
| -rw-r--r-- | pack-bitmap.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/pack-bitmap.c b/pack-bitmap.c index 01e14c34bd..058bdb5d7d 100644 --- a/pack-bitmap.c +++ b/pack-bitmap.c @@ -418,13 +418,12 @@ char *midx_bitmap_filename(struct multi_pack_index *midx) { struct strbuf buf = STRBUF_INIT; if (midx->has_chain) - get_split_midx_filename_ext(midx->source->odb->repo->hash_algo, &buf, - midx->source->path, + get_split_midx_filename_ext(midx->source, &buf, get_midx_checksum(midx), MIDX_EXT_BITMAP); else - get_midx_filename_ext(midx->source->odb->repo->hash_algo, &buf, - midx->source->path, get_midx_checksum(midx), + get_midx_filename_ext(midx->source, &buf, + get_midx_checksum(midx), MIDX_EXT_BITMAP); return strbuf_detach(&buf, NULL); @@ -463,8 +462,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(midx->source->odb->repo->hash_algo, &buf, - midx->source->path); + get_midx_filename(midx->source, &buf); trace2_data_string("bitmap", bitmap_repo(bitmap_git), "ignoring extra midx bitmap file", buf.buf); close(fd); |
