@@ -90,6 +90,9 @@ test_expect_success 'setup' '
90
90
cd worktree &&
91
91
mkdir done dtwo dthree &&
92
92
touch one two three done/one dtwo/two dthree/three &&
93
+ test-tool chmtime =-300 one two three done/one dtwo/two dthree/three &&
94
+ test-tool chmtime =-300 done dtwo dthree &&
95
+ test-tool chmtime =-300 . &&
93
96
git add one two done/one &&
94
97
: >.git/info/exclude &&
95
98
git update-index --untracked-cache &&
142
145
EOF
143
146
144
147
test_expect_success ' status first time (empty cache)' '
145
- avoid_racy &&
146
148
: >../trace.output &&
147
149
GIT_TRACE2_PERF="$TRASH_DIRECTORY/trace.output" \
148
150
git status --porcelain >../actual &&
@@ -166,7 +168,6 @@ test_expect_success 'untracked cache after first status' '
166
168
'
167
169
168
170
test_expect_success ' status second time (fully populated cache)' '
169
- avoid_racy &&
170
171
: >../trace.output &&
171
172
GIT_TRACE2_PERF="$TRASH_DIRECTORY/trace.output" \
172
173
git status --porcelain >../actual &&
@@ -190,8 +191,8 @@ test_expect_success 'untracked cache after second status' '
190
191
'
191
192
192
193
test_expect_success ' modify in root directory, one dir invalidation' '
193
- avoid_racy &&
194
194
: >four &&
195
+ test-tool chmtime =-240 four &&
195
196
: >../trace.output &&
196
197
GIT_TRACE2_PERF="$TRASH_DIRECTORY/trace.output" \
197
198
git status --porcelain >../actual &&
241
242
'
242
243
243
244
test_expect_success ' new .gitignore invalidates recursively' '
244
- avoid_racy &&
245
245
echo four >.gitignore &&
246
246
: >../trace.output &&
247
247
GIT_TRACE2_PERF="$TRASH_DIRECTORY/trace.output" \
292
292
'
293
293
294
294
test_expect_success ' new info/exclude invalidates everything' '
295
- avoid_racy &&
296
295
echo three >>.git/info/exclude &&
297
296
: >../trace.output &&
298
297
GIT_TRACE2_PERF="$TRASH_DIRECTORY/trace.output" \
@@ -520,14 +519,14 @@ test_expect_success 'create/modify files, some of which are gitignored' '
520
519
echo three >done/three && # three is gitignored
521
520
echo four >done/four && # four is gitignored at a higher level
522
521
echo five >done/five && # five is not gitignored
523
- echo test >base && #we need to ensure that the root dir is touched
524
- rm base &&
522
+ test-tool chmtime =-180 done/two done/three done/four done/five done &&
523
+ # we need to ensure that the root dir is touched (in the past);
524
+ test-tool chmtime =-180 . &&
525
525
sync_mtime
526
526
'
527
527
528
528
test_expect_success ' test sparse status with untracked cache' '
529
529
: >../trace.output &&
530
- avoid_racy &&
531
530
GIT_TRACE2_PERF="$TRASH_DIRECTORY/trace.output" \
532
531
git status --porcelain >../status.actual &&
533
532
iuc status --porcelain >../status.iuc &&
570
569
'
571
570
572
571
test_expect_success ' test sparse status again with untracked cache' '
573
- avoid_racy &&
574
572
: >../trace.output &&
575
573
GIT_TRACE2_PERF="$TRASH_DIRECTORY/trace.output" \
576
574
git status --porcelain >../status.actual &&
@@ -597,11 +595,11 @@ EOF
597
595
test_expect_success ' set up for test of subdir and sparse checkouts' '
598
596
mkdir done/sub &&
599
597
mkdir done/sub/sub &&
600
- echo "sub" > done/sub/sub/file
598
+ echo "sub" > done/sub/sub/file &&
599
+ test-tool chmtime =-120 done/sub/sub/file done/sub/sub done/sub done
601
600
'
602
601
603
602
test_expect_success ' test sparse status with untracked cache and subdir' '
604
- avoid_racy &&
605
603
: >../trace.output &&
606
604
GIT_TRACE2_PERF="$TRASH_DIRECTORY/trace.output" \
607
605
git status --porcelain >../status.actual &&
651
649
'
652
650
653
651
test_expect_success ' test sparse status again with untracked cache and subdir' '
654
- avoid_racy &&
655
652
: >../trace.output &&
656
653
GIT_TRACE2_PERF="$TRASH_DIRECTORY/trace.output" \
657
654
git status --porcelain >../status.actual &&
0 commit comments