Re: [PATCH v2 3/5] pack-write: pass hash_algo to `write_idx_file()`
- From
Toon Claes <toon@iotcl.com>
- Date
- Jan 17, 2025, 16:40 UTC
- Message-ID
- <87wmetieb6.fsf@iotcl.com>
- In-Reply-To
- <20250117-kn-the-repo-cleanup-v2-3-a7fdc19688f5@gmail.com>
Karthik Nayak <karthik.188@gmail.com> writes:
Show 7 quoted lines
> The `write_idx_file()` function uses the global `the_hash_algo` variable > to access the repository's hash function. To avoid global variable > usage, pass the hash function from the layers above. > > Since `stage_tmp_packfiles()` also resides in 'pack-write.c' and calls > `write_idx_file()`, update it to accept `the_hash_algo` as a parameter > and pass it through to the callee.
Technically speaking you're updating it to accept a `struct hash_algo`.
Besides from this nit, and the other nit I've submitted on the first patch, these changes look good to me. I'm doubtful any of the comments needs a reroll.
-- Toon