mirror of
https://github.com/git/git.git
synced 2024-11-27 20:14:30 +08:00
Merge branch 'rs/remove-approxidate-relative'
The approxidate() API has been simplified by losing an extra function that did the same thing as another one. * rs/remove-approxidate-relative: date: remove approxidate_relative()
This commit is contained in:
commit
fa9172c70a
14
date.c
14
date.c
@ -1366,20 +1366,6 @@ static timestamp_t approxidate_str(const char *date,
|
||||
return (timestamp_t)update_tm(&tm, &now, 0);
|
||||
}
|
||||
|
||||
timestamp_t approxidate_relative(const char *date)
|
||||
{
|
||||
struct timeval tv;
|
||||
timestamp_t timestamp;
|
||||
int offset;
|
||||
int errors = 0;
|
||||
|
||||
if (!parse_date_basic(date, ×tamp, &offset))
|
||||
return timestamp;
|
||||
|
||||
get_time(&tv);
|
||||
return approxidate_str(date, (const struct timeval *) &tv, &errors);
|
||||
}
|
||||
|
||||
timestamp_t approxidate_careful(const char *date, int *error_ret)
|
||||
{
|
||||
struct timeval tv;
|
||||
|
1
date.h
1
date.h
@ -68,7 +68,6 @@ int parse_expiry_date(const char *date, timestamp_t *timestamp);
|
||||
void datestamp(struct strbuf *out);
|
||||
#define approxidate(s) approxidate_careful((s), NULL)
|
||||
timestamp_t approxidate_careful(const char *, int *);
|
||||
timestamp_t approxidate_relative(const char *date);
|
||||
int date_overflows(timestamp_t date);
|
||||
time_t tm_to_time_t(const struct tm *tm);
|
||||
#endif
|
||||
|
@ -81,7 +81,7 @@ static void parse_approxidate(const char **argv)
|
||||
{
|
||||
for (; *argv; argv++) {
|
||||
timestamp_t t;
|
||||
t = approxidate_relative(*argv);
|
||||
t = approxidate(*argv);
|
||||
printf("%s -> %s\n", *argv, show_date(t, 0, DATE_MODE(ISO8601)));
|
||||
}
|
||||
}
|
||||
@ -90,7 +90,7 @@ static void parse_approx_timestamp(const char **argv)
|
||||
{
|
||||
for (; *argv; argv++) {
|
||||
timestamp_t t;
|
||||
t = approxidate_relative(*argv);
|
||||
t = approxidate(*argv);
|
||||
printf("%s -> %"PRItime"\n", *argv, t);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user