builtin/reflog: stop storing per-reflog expiry dates globally

As described in the preceding commit, the per-reflog expiry dates are
stored in a global pair of variables. Refactor the code so that they are
contained in `struct reflog_expire_options` to make the structure useful
in other contexts.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Patrick Steinhardt
2025-04-08 08:22:14 +02:00
committed by Junio C Hamano
parent 8565827570
commit 964f364de9
2 changed files with 20 additions and 18 deletions

View File

@@ -2,7 +2,15 @@
#define REFLOG_H
#include "refs.h"
struct reflog_expire_entry_option {
struct reflog_expire_entry_option *next;
timestamp_t expire_total;
timestamp_t expire_unreachable;
char pattern[FLEX_ARRAY];
};
struct reflog_expire_options {
struct reflog_expire_entry_option *entries, **entries_tail;
int stalefix;
int explicit_expiry;
timestamp_t default_expire_total;