Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/t/t9604-cvsimport-timestamps.sh # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / t / t9604-cvsimport-timestamps.sh` 89 lines ยท 2870 bytes Raw Blame History 1 #!/bin/sh 2 3 test_description='git cvsimport timestamps' 4 5 . ./lib-cvs.sh 6 7 test_lazy_prereq POSIX_TIMEZONE ' 8 local tz=XST-1XDT,M3.5.0,M11.1.0 9 echo "`1711846799` -> 2024-03-31 01:59:59 +0100" >expected && 10 TZ="$tz" test-tool date show:iso-local `1711846799` >actual && 11 test_cmp expected actual && 12 echo "`1711846800` -> 2024-03-31 03:00:00 +0200" >expected && 13 TZ="$tz" test-tool date show:iso-local `1711846800` >actual && 14 test_cmp expected actual && 15 echo "`1730591999` -> 2024-11-03 01:59:59 +0200" >expected && 16 TZ="$tz" test-tool date show:iso-local `1730591999` >actual && 17 test_cmp expected actual && 18 echo "`1730592000` -> 2024-11-03 01:00:00 +0100" >expected && 19 TZ="$tz" test-tool date show:iso-local `1730592000` >actual && 20 test_cmp expected actual 21 ' 22 23 setup_cvs_test_repository t9604 24 25 test_expect_success PERL,POSIX_TIMEZONE 'check timestamps are UTC' ' 26 27 TZ=CST6CDT,M4.1.0,M10.5.0 \ 28 git cvsimport -p"-x" -C module-1 module && 29 git cvsimport -p"-x" -C module-1 module && 30 ( 31 cd module-1 && 32 git log --format="%s %ai" 33 ) >actual-1 && 34 cat >expect-1 <<-EOF && 35 Rev 16 2006-10-29 07:00:01 +0000 36 Rev 15 2006-10-29 06:59:59 +0000 37 Rev 14 2006-04-02 08:00:01 +0000 38 Rev 13 2006-04-02 07:59:59 +0000 39 Rev 12 2005-12-01 00:00:00 +0000 40 Rev 11 2005-11-01 00:00:00 +0000 41 Rev 10 2005-10-01 00:00:00 +0000 42 Rev 9 2005-09-01 00:00:00 +0000 43 Rev 8 2005-08-01 00:00:00 +0000 44 Rev 7 2005-07-01 00:00:00 +0000 45 Rev 6 2005-06-01 00:00:00 +0000 46 Rev 5 2005-05-01 00:00:00 +0000 47 Rev 4 2005-04-01 00:00:00 +0000 48 Rev 3 2005-03-01 00:00:00 +0000 49 Rev 2 2005-02-01 00:00:00 +0000 50 Rev 1 2005-01-01 00:00:00 +0000 51 EOF 52 test_cmp expect-1 actual-1 53 ' 54 55 test_expect_success PERL,POSIX_TIMEZONE 'check timestamps with author-specific timezones' ' 56 57 cat >cvs-authors <<-EOF && 58 user1=User One 59 user2=User Two CST6CDT,M4.1.0,M10.5.0 60 user3=User Three EST5EDT,M4.1.0,M10.5.0 61 user4=User Four MST7MDT,M4.1.0,M10.5.0 62 EOF 63 git cvsimport -p"-x" -A cvs-authors -C module-2 module && 64 ( 65 cd module-2 && 66 git log --format="%s %ai %an" 67 ) >actual-2 && 68 cat >expect-2 <<-EOF && 69 Rev 16 2006-10-29 01:00:01 -0600 User Two 70 Rev 15 2006-10-29 01:59:59 -0500 User Two 71 Rev 14 2006-04-02 03:00:01 -0500 User Two 72 Rev 13 2006-04-02 01:59:59 -0600 User Two 73 Rev 12 2005-11-30 17:00:00 -0700 User Four 74 Rev 11 2005-10-31 19:00:00 -0500 User Three 75 Rev 10 2005-09-30 19:00:00 -0500 User Two 76 Rev 9 2005-09-01 00:00:00 +0000 User One 77 Rev 8 2005-07-31 18:00:00 -0600 User Four 78 Rev 7 2005-06-30 20:00:00 -0400 User Three 79 Rev 6 2005-05-31 19:00:00 -0500 User Two 80 Rev 5 2005-05-01 00:00:00 +0000 User One 81 Rev 4 2005-03-31 17:00:00 -0700 User Four 82 Rev 3 2005-02-28 19:00:00 -0500 User Three 83 Rev 2 2005-01-31 18:00:00 -0600 User Two 84 Rev 1 2005-01-01 00:00:00 +0000 User One 85 EOF 86 test_cmp expect-2 actual-2 87 ' 88 89 test_done