This is a small series to remove global variable usage from `pack-write.c`. Mostly it bubble's up the usage of global variables to upper layers. The only exception is in `write-midx.c`, which was cleaned of global variable usage, so there, we use the repo that is in available in the context. This series is based on fbe8d3079d (Git 2.48, 2025-01-10) with 'ps/more-sign-compare' and 'ps/the-repository' merged in. There are no conflicts with topics in 'next', however there is a conflict with 'tb/incremental-midx-part-2' in 'seen', the fix is simple but happy to merge that in too if necessary. Signed-off-by: Karthik Nayak <karthik.188@xxxxxxxxx> --- Karthik Nayak (5): pack-write: pass hash_algo to `fixup_pack_header_footer()` pack-write: pass repository to `index_pack_lockfile()` pack-write: pass hash_algo to `write_idx_file()` pack-write: pass hash_algo to `write_rev_file()` pack-write: pass hash_algo to `write_rev_*()` builtin/fast-import.c | 11 +++--- builtin/index-pack.c | 11 +++--- builtin/pack-objects.c | 12 +++--- builtin/receive-pack.c | 2 +- bulk-checkin.c | 7 ++-- fetch-pack.c | 4 +- midx-write.c | 4 +- pack-write.c | 99 +++++++++++++++++++++++++++----------------------- pack.h | 30 ++++++++++++--- 9 files changed, 106 insertions(+), 74 deletions(-) --- --- base-commit: 8b2efc058aaa3d1437678616bccf7c5f7ce1f92b change-id: 20250110-kn-the-repo-cleanup-44144fa42dc3 Thanks - Karthik