Taylor Blau <me@xxxxxxxxxxxx> 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.