From: Junio C Hamano Date: Mon, 24 Oct 2022 20:50:45 GMT Subject: Re: [PATCH 2/4] builtin/repack.c: pass "cruft_expiration" to `write_cruft_pack` Message-ID: In-Reply-To: <7d731d8dd5ebe0570a5dd8a88b3dd3104a79592a.1666636974.git.me@ttaylorr.com> Taylor Blau writes: > `builtin/repack.c`'s `write_cruft_pack()` is used to generate the cruft > pack when `--cruft` is supplied. It uses a static variable > "cruft_expiration" which is filled in by option parsing. > > A future patch will add an `--expire-to` option which allows `git > repack` to write a cruft pack containing the pruned objects out to a > separate repository. In order to implement this functionality, some > callers will have to pass a value for `cruft_expiration` different than > the one filled out by option parsing. > > Prepare for this by teaching `write_cruft_pack` to take a > "cruft_expiration" parameter, instead of reading a single static > variable. > > The (sole) existing caller of `write_cruft_pack()` will pass the value > for "cruft_expiration" filled in by option parsing, retaining existing > behavior. This means that we can make the variable local to > `cmd_repack()`, and eliminate the static declaration. Looks good to me.