Skip to content

Commit 42ea7a4

Browse files
derrickstoleegitster
authored andcommitted
t1600: fix racy index.skipHash test
The test 1600.6 can fail under --stress due to mtime collisions. Most of the tests include a removal of the index file to guarantee that the index is updated. However, the submodule test addded in ee1f0c2 (read-cache: add index.skipHash config option, 2023-01-06) did not include this removal. Thus, on rare occasions, the test can fail because the index still has a non-null trailing hash, as detected by the helper added in da9acde (test-lib-functions: add helper for trailing hash, 2023-01-06). By removing the submodule's index before the 'git -C sub add a' command, we guarantee that the index is rewritten with the new index.skipHash config option. Signed-off-by: Derrick Stolee <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 17194b1 commit 42ea7a4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

t/t1600-index.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ test_expect_success 'index.skipHash config option' '
8888
git -c protocol.file.allow=always submodule add ./ sub &&
8989
git config index.skipHash false &&
9090
git -C sub config index.skipHash true &&
91+
rm -f .git/modules/sub/index &&
9192
>sub/file &&
9293
git -C sub add a &&
9394
test_trailing_hash .git/modules/sub/index >hash &&

0 commit comments

Comments
 (0)