Skip to content

Commit db7bae2

Browse files
johnkeepinggitster
authored andcommitted
t6300: make UTC and local dates different
By setting the UTC time to 23:18:43 the date in +0200 is the following day, 2006-07-04. This will ensure that the test for "short-local" to be added in the following patch tests for different output from the "short" format. Signed-off-by: John Keeping <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent add00ba commit db7bae2

File tree

1 file changed

+35
-35
lines changed

1 file changed

+35
-35
lines changed

t/t6300-for-each-ref.sh

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ test_description='for-each-ref test'
88
. ./test-lib.sh
99
. "$TEST_DIRECTORY"/lib-gpg.sh
1010

11-
# Mon Jul 3 15:18:43 2006 +0000
12-
datestamp=1151939923
11+
# Mon Jul 3 23:18:43 2006 +0000
12+
datestamp=1151968723
1313
setdate_and_increment () {
1414
GIT_COMMITTER_DATE="$datestamp +0200"
1515
datestamp=$(expr "$datestamp" + 1)
@@ -61,21 +61,21 @@ test_atom head object ''
6161
test_atom head type ''
6262
test_atom head '*objectname' ''
6363
test_atom head '*objecttype' ''
64-
test_atom head author 'A U Thor <[email protected]> 1151939924 +0200'
64+
test_atom head author 'A U Thor <[email protected]> 1151968724 +0200'
6565
test_atom head authorname 'A U Thor'
6666
test_atom head authoremail '<[email protected]>'
67-
test_atom head authordate 'Mon Jul 3 17:18:44 2006 +0200'
68-
test_atom head committer 'C O Mitter <[email protected]> 1151939923 +0200'
67+
test_atom head authordate 'Tue Jul 4 01:18:44 2006 +0200'
68+
test_atom head committer 'C O Mitter <[email protected]> 1151968723 +0200'
6969
test_atom head committername 'C O Mitter'
7070
test_atom head committeremail '<[email protected]>'
71-
test_atom head committerdate 'Mon Jul 3 17:18:43 2006 +0200'
71+
test_atom head committerdate 'Tue Jul 4 01:18:43 2006 +0200'
7272
test_atom head tag ''
7373
test_atom head tagger ''
7474
test_atom head taggername ''
7575
test_atom head taggeremail ''
7676
test_atom head taggerdate ''
77-
test_atom head creator 'C O Mitter <[email protected]> 1151939923 +0200'
78-
test_atom head creatordate 'Mon Jul 3 17:18:43 2006 +0200'
77+
test_atom head creator 'C O Mitter <[email protected]> 1151968723 +0200'
78+
test_atom head creatordate 'Tue Jul 4 01:18:43 2006 +0200'
7979
test_atom head subject 'Initial'
8080
test_atom head contents:subject 'Initial'
8181
test_atom head body ''
@@ -96,7 +96,7 @@ test_atom tag parent ''
9696
test_atom tag numparent ''
9797
test_atom tag object $(git rev-parse refs/tags/testtag^0)
9898
test_atom tag type 'commit'
99-
test_atom tag '*objectname' '67a36f10722846e891fbada1ba48ed035de75581'
99+
test_atom tag '*objectname' 'ea122842f48be4afb2d1fc6a4b96c05885ab7463'
100100
test_atom tag '*objecttype' 'commit'
101101
test_atom tag author ''
102102
test_atom tag authorname ''
@@ -107,18 +107,18 @@ test_atom tag committername ''
107107
test_atom tag committeremail ''
108108
test_atom tag committerdate ''
109109
test_atom tag tag 'testtag'
110-
test_atom tag tagger 'C O Mitter <[email protected]> 1151939925 +0200'
110+
test_atom tag tagger 'C O Mitter <[email protected]> 1151968725 +0200'
111111
test_atom tag taggername 'C O Mitter'
112112
test_atom tag taggeremail '<[email protected]>'
113-
test_atom tag taggerdate 'Mon Jul 3 17:18:45 2006 +0200'
114-
test_atom tag creator 'C O Mitter <[email protected]> 1151939925 +0200'
115-
test_atom tag creatordate 'Mon Jul 3 17:18:45 2006 +0200'
116-
test_atom tag subject 'Tagging at 1151939927'
117-
test_atom tag contents:subject 'Tagging at 1151939927'
113+
test_atom tag taggerdate 'Tue Jul 4 01:18:45 2006 +0200'
114+
test_atom tag creator 'C O Mitter <[email protected]> 1151968725 +0200'
115+
test_atom tag creatordate 'Tue Jul 4 01:18:45 2006 +0200'
116+
test_atom tag subject 'Tagging at 1151968727'
117+
test_atom tag contents:subject 'Tagging at 1151968727'
118118
test_atom tag body ''
119119
test_atom tag contents:body ''
120120
test_atom tag contents:signature ''
121-
test_atom tag contents 'Tagging at 1151939927
121+
test_atom tag contents 'Tagging at 1151968727
122122
'
123123
test_atom tag HEAD ' '
124124

@@ -168,16 +168,16 @@ test_date () {
168168

169169
test_expect_success 'Check unformatted date fields output' '
170170
test_date "" \
171-
"Mon Jul 3 17:18:43 2006 +0200" \
172-
"Mon Jul 3 17:18:44 2006 +0200" \
173-
"Mon Jul 3 17:18:45 2006 +0200"
171+
"Tue Jul 4 01:18:43 2006 +0200" \
172+
"Tue Jul 4 01:18:44 2006 +0200" \
173+
"Tue Jul 4 01:18:45 2006 +0200"
174174
'
175175

176176
test_expect_success 'Check format "default" formatted date fields output' '
177177
test_date default \
178-
"Mon Jul 3 17:18:43 2006 +0200" \
179-
"Mon Jul 3 17:18:44 2006 +0200" \
180-
"Mon Jul 3 17:18:45 2006 +0200"
178+
"Tue Jul 4 01:18:43 2006 +0200" \
179+
"Tue Jul 4 01:18:44 2006 +0200" \
180+
"Tue Jul 4 01:18:45 2006 +0200"
181181
'
182182

183183
# Don't know how to do relative check because I can't know when this script
@@ -191,36 +191,36 @@ test_expect_success 'Check format "relative" date fields output' '
191191
'
192192

193193
test_expect_success 'Check format "short" date fields output' '
194-
test_date short 2006-07-03 2006-07-03 2006-07-03
194+
test_date short 2006-07-04 2006-07-04 2006-07-04
195195
'
196196

197197
test_expect_success 'Check format "local" date fields output' '
198198
test_date local \
199-
"Mon Jul 3 15:18:43 2006" \
200-
"Mon Jul 3 15:18:44 2006" \
201-
"Mon Jul 3 15:18:45 2006"
199+
"Mon Jul 3 23:18:43 2006" \
200+
"Mon Jul 3 23:18:44 2006" \
201+
"Mon Jul 3 23:18:45 2006"
202202
'
203203

204204
test_expect_success 'Check format "iso8601" date fields output' '
205205
test_date iso8601 \
206-
"2006-07-03 17:18:43 +0200" \
207-
"2006-07-03 17:18:44 +0200" \
208-
"2006-07-03 17:18:45 +0200"
206+
"2006-07-04 01:18:43 +0200" \
207+
"2006-07-04 01:18:44 +0200" \
208+
"2006-07-04 01:18:45 +0200"
209209
'
210210

211211
test_expect_success 'Check format "rfc2822" date fields output' '
212212
test_date rfc2822 \
213-
"Mon, 3 Jul 2006 17:18:43 +0200" \
214-
"Mon, 3 Jul 2006 17:18:44 +0200" \
215-
"Mon, 3 Jul 2006 17:18:45 +0200"
213+
"Tue, 4 Jul 2006 01:18:43 +0200" \
214+
"Tue, 4 Jul 2006 01:18:44 +0200" \
215+
"Tue, 4 Jul 2006 01:18:45 +0200"
216216
'
217217

218218
test_expect_success 'Check format "raw" date fields output' '
219-
test_date raw "1151939923 +0200" "1151939924 +0200" "1151939925 +0200"
219+
test_date raw "1151968723 +0200" "1151968724 +0200" "1151968725 +0200"
220220
'
221221

222222
test_expect_success 'Check format of strftime date fields' '
223-
echo "my date is 2006-07-03" >expected &&
223+
echo "my date is 2006-07-04" >expected &&
224224
git for-each-ref \
225225
--format="%(authordate:format:my date is %Y-%m-%d)" \
226226
refs/heads >actual &&
@@ -528,8 +528,8 @@ body contents
528528
$sig"
529529

530530
cat >expected <<EOF
531-
$(git rev-parse refs/tags/master) <[email protected]> refs/tags/master
532531
$(git rev-parse refs/tags/bogo) <[email protected]> refs/tags/bogo
532+
$(git rev-parse refs/tags/master) <[email protected]> refs/tags/master
533533
EOF
534534

535535
test_expect_success 'Verify sort with multiple keys' '

0 commit comments

Comments
 (0)