Skip to content

Commit fa9172c

Browse files
committed
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()
2 parents cbfe844 + 8a7f0b6 commit fa9172c

File tree

3 files changed

+2
-17
lines changed

3 files changed

+2
-17
lines changed

date.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1366,20 +1366,6 @@ static timestamp_t approxidate_str(const char *date,
13661366
return (timestamp_t)update_tm(&tm, &now, 0);
13671367
}
13681368

1369-
timestamp_t approxidate_relative(const char *date)
1370-
{
1371-
struct timeval tv;
1372-
timestamp_t timestamp;
1373-
int offset;
1374-
int errors = 0;
1375-
1376-
if (!parse_date_basic(date, &timestamp, &offset))
1377-
return timestamp;
1378-
1379-
get_time(&tv);
1380-
return approxidate_str(date, (const struct timeval *) &tv, &errors);
1381-
}
1382-
13831369
timestamp_t approxidate_careful(const char *date, int *error_ret)
13841370
{
13851371
struct timeval tv;

date.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ int parse_expiry_date(const char *date, timestamp_t *timestamp);
6868
void datestamp(struct strbuf *out);
6969
#define approxidate(s) approxidate_careful((s), NULL)
7070
timestamp_t approxidate_careful(const char *, int *);
71-
timestamp_t approxidate_relative(const char *date);
7271
int date_overflows(timestamp_t date);
7372
time_t tm_to_time_t(const struct tm *tm);
7473
#endif

t/helper/test-date.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ static void parse_approxidate(const char **argv)
8181
{
8282
for (; *argv; argv++) {
8383
timestamp_t t;
84-
t = approxidate_relative(*argv);
84+
t = approxidate(*argv);
8585
printf("%s -> %s\n", *argv, show_date(t, 0, DATE_MODE(ISO8601)));
8686
}
8787
}
@@ -90,7 +90,7 @@ static void parse_approx_timestamp(const char **argv)
9090
{
9191
for (; *argv; argv++) {
9292
timestamp_t t;
93-
t = approxidate_relative(*argv);
93+
t = approxidate(*argv);
9494
printf("%s -> %"PRItime"\n", *argv, t);
9595
}
9696
}

0 commit comments

Comments
 (0)