diff options
| author | Patrick Steinhardt <ps@pks.im> | 2025-04-08 08:22:15 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-04-08 07:53:27 -0700 |
| commit | d20fc193b663cd98364c07195e6cb38618a30c10 (patch) | |
| tree | c7cdcf46eb45a6c5c33e40e240090a3da9694950 /reflog.h | |
| parent | 964f364de9935592ff187cdf26b87a75e762c26c (diff) | |
| download | git-d20fc193b663cd98364c07195e6cb38618a30c10.tar.gz | |
builtin/reflog: make functions regarding `reflog_expire_options` public
Make functions that are required to manage `reflog_expire_options`
available elsewhere by moving them into "reflog.c" and exposing them in
the corresponding header. The functions will be used in a subsequent
commit.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'reflog.h')
| -rw-r--r-- | reflog.h | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -2,6 +2,9 @@ #define REFLOG_H #include "refs.h" +#define REFLOG_EXPIRE_TOTAL (1 << 0) +#define REFLOG_EXPIRE_UNREACH (1 << 1) + struct reflog_expire_entry_option { struct reflog_expire_entry_option *next; timestamp_t expire_total; @@ -24,6 +27,20 @@ struct reflog_expire_options { .default_expire_unreachable = now - 90 * 24 * 3600, \ } +/* + * Parse the reflog expire configuration. This should be used with + * `repo_config()`. + */ +int reflog_expire_config(const char *var, const char *value, + const struct config_context *ctx, void *cb); + +/* + * Adapt the options so that they apply to the given refname. This applies any + * per-reference reflog expiry configuration that may exist to the options. + */ +void reflog_expire_options_set_refname(struct reflog_expire_options *cb, + const char *refname); + struct expire_reflog_policy_cb { enum { UE_NORMAL, |
