MCPcopy Create free account
hub / github.com/git/git / parse_expiry_date

Function parse_expiry_date

date.c:957–977  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

955}
956
957int parse_expiry_date(const char *date, timestamp_t *timestamp)
958{
959 int errors = 0;
960
961 if (!strcmp(date, "never") || !strcmp(date, "false"))
962 *timestamp = 0;
963 else if (!strcmp(date, "all") || !strcmp(date, "now"))
964 /*
965 * We take over "now" here, which usually translates
966 * to the current timestamp. This is because the user
967 * really means to expire everything that was done in
968 * the past, and by definition reflogs are the record
969 * of the past, and there is nothing from the future
970 * to be kept.
971 */
972 *timestamp = TIME_MAX;
973 else
974 *timestamp = approxidate_careful(date, &errors);
975
976 return errors;
977}
978
979int parse_date(const char *date, struct strbuf *result)
980{

Callers 9

git_config_expiry_dateFunction · 0.85
parse_opt_expiry_date_cbFunction · 0.85
expire_total_callbackFunction · 0.85
worktree_prune_conditionFunction · 0.85
cmd_gcFunction · 0.85

Calls 1

approxidate_carefulFunction · 0.85

Tested by

no test coverage detected