@@ -90,6 +90,9 @@ test_expect_success 'setup' '
9090 cd worktree &&
9191 mkdir done dtwo dthree &&
9292 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 . &&
9396 git add one two done/one &&
9497 : >.git/info/exclude &&
9598 git update-index --untracked-cache &&
142145EOF
143146
144147test_expect_success ' status first time (empty cache)' '
145- avoid_racy &&
146148 : >../trace.output &&
147149 GIT_TRACE2_PERF="$TRASH_DIRECTORY/trace.output" \
148150 git status --porcelain >../actual &&
@@ -166,7 +168,6 @@ test_expect_success 'untracked cache after first status' '
166168'
167169
168170test_expect_success ' status second time (fully populated cache)' '
169- avoid_racy &&
170171 : >../trace.output &&
171172 GIT_TRACE2_PERF="$TRASH_DIRECTORY/trace.output" \
172173 git status --porcelain >../actual &&
@@ -190,8 +191,8 @@ test_expect_success 'untracked cache after second status' '
190191'
191192
192193test_expect_success ' modify in root directory, one dir invalidation' '
193- avoid_racy &&
194194 : >four &&
195+ test-tool chmtime =-240 four &&
195196 : >../trace.output &&
196197 GIT_TRACE2_PERF="$TRASH_DIRECTORY/trace.output" \
197198 git status --porcelain >../actual &&
241242'
242243
243244test_expect_success ' new .gitignore invalidates recursively' '
244- avoid_racy &&
245245 echo four >.gitignore &&
246246 : >../trace.output &&
247247 GIT_TRACE2_PERF="$TRASH_DIRECTORY/trace.output" \
292292'
293293
294294test_expect_success ' new info/exclude invalidates everything' '
295- avoid_racy &&
296295 echo three >>.git/info/exclude &&
297296 : >../trace.output &&
298297 GIT_TRACE2_PERF="$TRASH_DIRECTORY/trace.output" \
@@ -520,14 +519,14 @@ test_expect_success 'create/modify files, some of which are gitignored' '
520519 echo three >done/three && # three is gitignored
521520 echo four >done/four && # four is gitignored at a higher level
522521 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 . &&
525525 sync_mtime
526526'
527527
528528test_expect_success ' test sparse status with untracked cache' '
529529 : >../trace.output &&
530- avoid_racy &&
531530 GIT_TRACE2_PERF="$TRASH_DIRECTORY/trace.output" \
532531 git status --porcelain >../status.actual &&
533532 iuc status --porcelain >../status.iuc &&
570569'
571570
572571test_expect_success ' test sparse status again with untracked cache' '
573- avoid_racy &&
574572 : >../trace.output &&
575573 GIT_TRACE2_PERF="$TRASH_DIRECTORY/trace.output" \
576574 git status --porcelain >../status.actual &&
@@ -597,11 +595,11 @@ EOF
597595test_expect_success ' set up for test of subdir and sparse checkouts' '
598596 mkdir done/sub &&
599597 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
601600'
602601
603602test_expect_success ' test sparse status with untracked cache and subdir' '
604- avoid_racy &&
605603 : >../trace.output &&
606604 GIT_TRACE2_PERF="$TRASH_DIRECTORY/trace.output" \
607605 git status --porcelain >../status.actual &&
651649'
652650
653651test_expect_success ' test sparse status again with untracked cache and subdir' '
654- avoid_racy &&
655652 : >../trace.output &&
656653 GIT_TRACE2_PERF="$TRASH_DIRECTORY/trace.output" \
657654 git status --porcelain >../status.actual &&
0 commit comments