| 955 | } |
| 956 | |
| 957 | int 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 | |
| 979 | int parse_date(const char *date, struct strbuf *result) |
| 980 | { |
no test coverage detected