diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-12-06 18:23:37 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-12-06 18:23:37 +0100 |
commit | 6cddb7362ca3c7312b57a4f172bca5c953a45b6c (patch) | |
tree | 62b363b31ccae02533ee81eea365cb975ab39cce /config.c | |
parent | Merge branch 'tz/branch-doc-remove-set-upstream' (diff) | |
parent | config: add --expiry-date (diff) | |
download | git-6cddb7362ca3c7312b57a4f172bca5c953a45b6c.tar.xz git-6cddb7362ca3c7312b57a4f172bca5c953a45b6c.zip |
Merge branch 'hm/config-parse-expiry-date'
"git config --expiry-date gc.reflogexpire" can read "2.weeks" from
the configuration and report it as a timestamp, just like "--int"
would read "1k" and report 1024, to help consumption by scripts.
* hm/config-parse-expiry-date:
config: add --expiry-date
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -990,6 +990,16 @@ int git_config_pathname(const char **dest, const char *var, const char *value) return 0; } +int git_config_expiry_date(timestamp_t *timestamp, const char *var, const char *value) +{ + if (!value) + return config_error_nonbool(var); + if (parse_expiry_date(value, timestamp)) + return error(_("'%s' for '%s' is not a valid timestamp"), + value, var); + return 0; +} + static int git_default_core_config(const char *var, const char *value) { /* This needs a better name */ |