test-date: drop unused parameter to getnanos()
authorJeff King <peff@peff.net>
Wed, 6 Feb 2019 19:35:52 +0000 (14:35 -0500)
committerJunio C Hamano <gitster@pobox.com>
Wed, 6 Feb 2019 20:17:10 +0000 (12:17 -0800)
The getnanos() helper always gets the current time from our
getnanotime() facility. The caller cannot override it via TEST_DATE_NOW,
and hence we simply ignore the "now" parameter to the function. Let's
remove it, as it may mislead callers into thinking it does something.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/helper/test-date.c
index 792a80537467bd7c759754fea5fb226697c5d633..f9e2b91ed1b3dbe4efa2d1d540cabb5dce171b57 100644 (file)
@@ -83,7 +83,7 @@ static void parse_approx_timestamp(const char **argv, struct timeval *now)
        }
 }
 
-static void getnanos(const char **argv, struct timeval *now)
+static void getnanos(const char **argv)
 {
        double seconds = getnanotime() / 1.0e9;
 
@@ -119,7 +119,7 @@ int cmd__date(int argc, const char **argv)
        else if (!strcmp(*argv, "timestamp"))
                parse_approx_timestamp(argv+1, &now);
        else if (!strcmp(*argv, "getnanos"))
-               getnanos(argv+1, &now);
+               getnanos(argv+1);
        else if (!strcmp(*argv, "is64bit"))
                return sizeof(timestamp_t) == 8 ? 0 : 1;
        else if (!strcmp(*argv, "time_t-is64bit"))