diff options
author | Patrick Steinhardt <ps@pks.im> | 2025-06-03 16:01:19 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2025-06-03 08:30:52 -0700 |
commit | d2b084c66037f1a77b3e061ae7e4d96cbdbf6c05 (patch) | |
tree | 544cea981974816be57ec0fbbcaf5e6d278439c1 /git-gui/lib/commit.tcl | |
parent | 697202b0b1c7c02208c620f96c608e0817d079dd (diff) |
builtin/gc: avoid global state in `gc_before_repack()`
The `gc_before_repack()` should only ever run once in git-gc(1), but we
may end up calling it twice when the "--detach" flag is passed. The
duplicated call is avoided though via a static flag in this function.
This pattern is somewhat unintuitive though. Refactor it to drop the
static flag and instead guard the second call of `gc_before_repack()`
via `opts.detach`.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-gui/lib/commit.tcl')
0 files changed, 0 insertions, 0 deletions