diff options
author | Patrick Steinhardt <ps@pks.im> | 2024-08-13 11:14:03 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-08-13 19:01:03 +0200 |
commit | 44ebcd6254ce9e42eeaa70b67750efb356157914 (patch) | |
tree | 78a0c010f979cd2a3cdc5a03cb3f61821c962633 /config.c | |
parent | config: pass repo to `git_config_get_expiry()` (diff) | |
download | git-44ebcd6254ce9e42eeaa70b67750efb356157914.tar.xz git-44ebcd6254ce9e42eeaa70b67750efb356157914.zip |
config: pass repo to `git_config_get_expiry_in_days()`
Refactor `git_config_get_expiry_in_days()` to accept a `struct
repository` such that we can get rid of the implicit dependency on
`the_repository`. Rename the function accordingly.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -2779,13 +2779,14 @@ int repo_config_get_expiry(struct repository *r, const char *key, const char **o return ret; } -int git_config_get_expiry_in_days(const char *key, timestamp_t *expiry, timestamp_t now) +int repo_config_get_expiry_in_days(struct repository *r, const char *key, + timestamp_t *expiry, timestamp_t now) { const char *expiry_string; intmax_t days; timestamp_t when; - if (git_config_get_string_tmp(key, &expiry_string)) + if (repo_config_get_string_tmp(r, key, &expiry_string)) return 1; /* no such thing */ if (git_parse_signed(expiry_string, &days, maximum_signed_value_of_type(int))) { |