mbox series

[0/2] Date test code clean-up

Message ID 20190909014711.3894-1-ischis2@cox.net (mailing list archive)
Headers show
Series Date test code clean-up | expand

Message

Stephen P. Smith Sept. 9, 2019, 1:47 a.m. UTC
As part of a previous patch submission[1], a cleanup patch was
suggested to remove a now unnecessary passing of a date environment
variable to the production code.

While the two patches in the set could easily be submitted as a single
patch, I split the removal of the getenv() call into a second
patch. I did that to make the comment about the initialization of `x`
more localized to the change.

[1] https://public-inbox.org/git/xmqq5zuge2y7.fsf@gitster-ct.c.googlers.com

Stephen P. Smith (2):
  Quit passing 'now' to date code
  test_date.c: Remove reference to GIT_TEST_DATE_NOW

 cache.h              |  5 ++---
 date.c               | 27 +++++++++++++--------------
 t/helper/test-date.c | 27 +++++++++------------------
 3 files changed, 24 insertions(+), 35 deletions(-)

Comments

Junio C Hamano Sept. 9, 2019, 6:32 p.m. UTC | #1
"Stephen P. Smith" <ischis2@cox.net> writes:

> As part of a previous patch submission[1], a cleanup patch was
> suggested to remove a now unnecessary passing of a date environment
> variable to the production code.

It looks like that the idea to realize that get_time() that is aware
of GIT_TEST_DATE_NOW is always called before functions like
show_date_relative(), approxidate_str() and approxidate_careful(),
and arrange it to be called in the lower level of the callchain,
which makes sense to me.


Thanks for tying the loose end.