Skip to content

Commit 0275e4d

Browse files
mstrapgitster
authored andcommitted
t7508: fix bogus mtime verification
The current `grep`-approach in "--no-optional-locks prevents index update" may fail e.g. for `out` file contents "1234567890999" [1]. Fix this by using test-lib's new mtime-verification API. [1] https://lore.kernel.org/git/[email protected]/T/#u Signed-off-by: Marc Strapetz <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ab6245b commit 0275e4d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

t/t7508-status.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1647,13 +1647,11 @@ test_expect_success '"Initial commit" should not be noted in commit template' '
16471647
'
16481648

16491649
test_expect_success '--no-optional-locks prevents index update' '
1650-
test-tool chmtime =1234567890 .git/index &&
1650+
test_set_magic_mtime .git/index &&
16511651
git --no-optional-locks status &&
1652-
test-tool chmtime --get .git/index >out &&
1653-
grep ^1234567890 out &&
1652+
test_is_magic_mtime .git/index &&
16541653
git status &&
1655-
test-tool chmtime --get .git/index >out &&
1656-
! grep ^1234567890 out
1654+
! test_is_magic_mtime .git/index
16571655
'
16581656

16591657
test_done

0 commit comments

Comments
 (0)