diff options
author | Derrick Stolee <derrickstolee@github.com> | 2023-01-17 17:49:27 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-01-17 18:41:44 +0300 |
commit | 42ea7a41502718ca9622a2f32dedaddc92b00a0b (patch) | |
tree | 7cb57d6eb7cdf4cdcdddc7dc7645365726647a30 /t/t1600-index.sh | |
parent | 17194b195d5db1cfd19af57e817c29bd3fa75c02 (diff) |
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 ee1f0c242ef
(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 da9acde14ed (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 <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1600-index.sh')
-rwxr-xr-x | t/t1600-index.sh | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/t/t1600-index.sh b/t/t1600-index.sh index 0ebbae1305..9368d82f7d 100755 --- a/t/t1600-index.sh +++ b/t/t1600-index.sh @@ -88,6 +88,7 @@ test_expect_success 'index.skipHash config option' ' git -c protocol.file.allow=always submodule add ./ sub && git config index.skipHash false && git -C sub config index.skipHash true && + rm -f .git/modules/sub/index && >sub/file && git -C sub add a && test_trailing_hash .git/modules/sub/index >hash && |