git/t/t9604-cvsimport-timestamps.sh
Patrick Steinhardt fba95dad6a t: mark a bunch of tests as leak-free
There are a bunch of tests which do not have any leaks:

  - t0411: Introduced via 5c5a4a1c05 (t0411: add tests for cloning from
    partial repo, 2024-01-28), passes since its inception.

  - t0610: Introduced via 57db2a094d (refs: introduce reftable backend,
    2024-02-07), passes since its inception.

  - t2405: Passes since 6741e917de (repository: avoid leaking
    `fsmonitor` data, 2024-04-12).

  - t7423: Introduced via b20c10fd9b (t7423: add tests for symlinked
    submodule directories, 2024-01-28), passes since e8d0608944
    (submodule: require the submodule path to contain directories only,
    2024-03-26). The fix is not obviously related, but probably works
    because we now die early in many code paths.

  - t9xxx: All of these are exercising CVS-related tooling and pass
    since at least Git v2.40. It's likely that these pass for a long
    time already, but nobody ever noticed because Git developers do not
    tend to have CVS on their machines.

Mark all of these tests as passing.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-05-27 11:19:57 -07:00

91 lines
2.8 KiB
Bash
Executable file

#!/bin/sh
test_description='git cvsimport timestamps'
TEST_PASSES_SANITIZE_LEAK=true
. ./lib-cvs.sh
test_lazy_prereq POSIX_TIMEZONE '
local tz=XST-1XDT,M3.5.0,M11.1.0
echo "1711846799 -> 2024-03-31 01:59:59 +0100" >expected &&
TZ="$tz" test-tool date show:iso-local 1711846799 >actual &&
test_cmp expected actual &&
echo "1711846800 -> 2024-03-31 03:00:00 +0200" >expected &&
TZ="$tz" test-tool date show:iso-local 1711846800 >actual &&
test_cmp expected actual &&
echo "1730591999 -> 2024-11-03 01:59:59 +0200" >expected &&
TZ="$tz" test-tool date show:iso-local 1730591999 >actual &&
test_cmp expected actual &&
echo "1730592000 -> 2024-11-03 01:00:00 +0100" >expected &&
TZ="$tz" test-tool date show:iso-local 1730592000 >actual &&
test_cmp expected actual
'
setup_cvs_test_repository t9604
test_expect_success PERL,POSIX_TIMEZONE 'check timestamps are UTC' '
TZ=CST6CDT,M4.1.0,M10.5.0 \
git cvsimport -p"-x" -C module-1 module &&
git cvsimport -p"-x" -C module-1 module &&
(
cd module-1 &&
git log --format="%s %ai"
) >actual-1 &&
cat >expect-1 <<-EOF &&
Rev 16 2006-10-29 07:00:01 +0000
Rev 15 2006-10-29 06:59:59 +0000
Rev 14 2006-04-02 08:00:01 +0000
Rev 13 2006-04-02 07:59:59 +0000
Rev 12 2005-12-01 00:00:00 +0000
Rev 11 2005-11-01 00:00:00 +0000
Rev 10 2005-10-01 00:00:00 +0000
Rev 9 2005-09-01 00:00:00 +0000
Rev 8 2005-08-01 00:00:00 +0000
Rev 7 2005-07-01 00:00:00 +0000
Rev 6 2005-06-01 00:00:00 +0000
Rev 5 2005-05-01 00:00:00 +0000
Rev 4 2005-04-01 00:00:00 +0000
Rev 3 2005-03-01 00:00:00 +0000
Rev 2 2005-02-01 00:00:00 +0000
Rev 1 2005-01-01 00:00:00 +0000
EOF
test_cmp expect-1 actual-1
'
test_expect_success PERL,POSIX_TIMEZONE 'check timestamps with author-specific timezones' '
cat >cvs-authors <<-EOF &&
user1=User One <user1@domain.org>
user2=User Two <user2@domain.org> CST6CDT,M4.1.0,M10.5.0
user3=User Three <user3@domain.org> EST5EDT,M4.1.0,M10.5.0
user4=User Four <user4@domain.org> MST7MDT,M4.1.0,M10.5.0
EOF
git cvsimport -p"-x" -A cvs-authors -C module-2 module &&
(
cd module-2 &&
git log --format="%s %ai %an"
) >actual-2 &&
cat >expect-2 <<-EOF &&
Rev 16 2006-10-29 01:00:01 -0600 User Two
Rev 15 2006-10-29 01:59:59 -0500 User Two
Rev 14 2006-04-02 03:00:01 -0500 User Two
Rev 13 2006-04-02 01:59:59 -0600 User Two
Rev 12 2005-11-30 17:00:00 -0700 User Four
Rev 11 2005-10-31 19:00:00 -0500 User Three
Rev 10 2005-09-30 19:00:00 -0500 User Two
Rev 9 2005-09-01 00:00:00 +0000 User One
Rev 8 2005-07-31 18:00:00 -0600 User Four
Rev 7 2005-06-30 20:00:00 -0400 User Three
Rev 6 2005-05-31 19:00:00 -0500 User Two
Rev 5 2005-05-01 00:00:00 +0000 User One
Rev 4 2005-03-31 17:00:00 -0700 User Four
Rev 3 2005-02-28 19:00:00 -0500 User Three
Rev 2 2005-01-31 18:00:00 -0600 User Two
Rev 1 2005-01-01 00:00:00 +0000 User One
EOF
test_cmp expect-2 actual-2
'
test_done