summaryrefslogtreecommitdiff
path: root/parse-options-cb.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-04-25 11:13:49 -0700
committerJunio C Hamano <gitster@pobox.com>2013-04-25 11:42:10 -0700
commit27ec394a9701675762f02e9af464be2c297c6cf1 (patch)
tree80e8547957da5c45f30847b553b3af54621281b0 /parse-options-cb.c
parent8a09e6c5f9010ac7159ef39a03b9a36bf233eaca (diff)
downloadgit-27ec394a9701675762f02e9af464be2c297c6cf1.tar.gz
prune: introduce OPT_EXPIRY_DATE() and use it
Earlier we added support for --expire=all (or --expire=now) that considers all crufts, regardless of their age, as eligible for garbage collection by turning command argument parsers that use approxidate() to use parse_expiry_date(), but "git prune" used a built-in parse-options facility OPT_DATE() and did not benefit from the new function. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'parse-options-cb.c')
-rw-r--r--parse-options-cb.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/parse-options-cb.c b/parse-options-cb.c
index 0de5fb168a..be8c413cfe 100644
--- a/parse-options-cb.c
+++ b/parse-options-cb.c
@@ -33,6 +33,12 @@ int parse_opt_approxidate_cb(const struct option *opt, const char *arg,
return 0;
}
+int parse_opt_expiry_date_cb(const struct option *opt, const char *arg,
+ int unset)
+{
+ return parse_expiry_date(arg, (unsigned long *)opt->value);
+}
+
int parse_opt_color_flag_cb(const struct option *opt, const char *arg,
int unset)
{