summaryrefslogtreecommitdiff
path: root/t/helper
diff options
context:
space:
mode:
authorLibravatar Johannes Schindelin <johannes.schindelin@gmx.de>2017-04-20 22:58:21 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-04-20 22:07:15 -0700
commitefac8ac84b8802d654d517468dbe822273b316df (patch)
treef7311b5b7a9f62d0dd8d98f30b80cf84618f77e1 /t/helper
parentt0006 & t5000: prepare for 64-bit timestamps (diff)
downloadtgif-efac8ac84b8802d654d517468dbe822273b316df.tar.xz
t0006 & t5000: skip "far in the future" test when time_t is too limited
Git's source code refers to timestamps as unsigned long, which is ill-defined, as there is no guarantee about the number of bits that data type has. In preparation of switching to another data type that is large enough to hold "far in the future" dates, we need to prepare the t0006-date.sh script for the case where we *still* cannot format those dates if the system library uses 32-bit time_t. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/helper')
-rw-r--r--t/helper/test-date.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/t/helper/test-date.c b/t/helper/test-date.c
index 4727bea255..ac7c66c733 100644
--- a/t/helper/test-date.c
+++ b/t/helper/test-date.c
@@ -5,7 +5,8 @@ static const char *usage_msg = "\n"
" test-date show:<format> [time_t]...\n"
" test-date parse [date]...\n"
" test-date approxidate [date]...\n"
-" test-date is64bit\n";
+" test-date is64bit\n"
+" test-date time_t-is64bit\n";
static void show_relative_dates(const char **argv, struct timeval *now)
{
@@ -96,6 +97,8 @@ int cmd_main(int argc, const char **argv)
parse_approxidate(argv+1, &now);
else if (!strcmp(*argv, "is64bit"))
return sizeof(unsigned long) == 8 ? 0 : 1;
+ else if (!strcmp(*argv, "time_t-is64bit"))
+ return sizeof(time_t) == 8 ? 0 : 1;
else
usage(usage_msg);
return 0;