Skip to content

Commit b23d8b2

Browse files
committed
Work around test failures due to timestamps being unsigned long
Git's source code refers to timestamps as unsigned longs. On 32-bit platforms, as well as on Windows, unsigned long is not large enough to capture dates that are "absurdly far in the future". While we will fix this issue properly by replacing unsigned long -> time_t, on the maint track we want to be a bit more conservative and just skip those tests. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent dda2687 commit b23d8b2

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

t/t0006-date.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,17 @@ check_show default "$TIME" 'Wed Jun 15 16:13:20 2016 +0200'
4848
check_show raw "$TIME" '1466000000 +0200'
4949
check_show iso-local "$TIME" '2016-06-15 14:13:20 +0000'
5050

51-
# arbitrary time absurdly far in the future
52-
FUTURE="5758122296 -0400"
53-
check_show iso "$FUTURE" "2152-06-19 18:24:56 -0400"
54-
check_show iso-local "$FUTURE" "2152-06-19 22:24:56 +0000"
51+
case "$(test-date show:iso 9999999999)" in
52+
*2038*)
53+
# on this platform, unsigned long is 32-bit, i.e. not large enough
54+
;;
55+
*)
56+
# arbitrary time absurdly far in the future
57+
FUTURE="5758122296 -0400"
58+
check_show iso "$FUTURE" "2152-06-19 18:24:56 -0400"
59+
check_show iso-local "$FUTURE" "2152-06-19 22:24:56 +0000"
60+
;;
61+
esac
5562

5663
check_parse() {
5764
echo "$1 -> $2" >expect

0 commit comments

Comments
 (0)