summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Marc Strapetz <marc.strapetz@syntevo.com>2022-01-07 11:17:29 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2022-01-07 12:37:30 -0800
commit0275e4daabed330c4d27cc9a482c2d23d7544aca (patch)
tree96e43cb9e4e17159ba366f0239f5ba2c97f49abf
parenttest-lib: introduce API for verifying file mtime (diff)
downloadtgif-0275e4daabed330c4d27cc9a482c2d23d7544aca.tar.xz
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/xmqqczl5hpaq.fsf@gitster.g/T/#u Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xt/t7508-status.sh8
1 files changed, 3 insertions, 5 deletions
diff --git a/t/t7508-status.sh b/t/t7508-status.sh
index 05c6c02435..b9efd2613d 100755
--- a/t/t7508-status.sh
+++ b/t/t7508-status.sh
@@ -1647,13 +1647,11 @@ test_expect_success '"Initial commit" should not be noted in commit template' '
'
test_expect_success '--no-optional-locks prevents index update' '
- test-tool chmtime =1234567890 .git/index &&
+ test_set_magic_mtime .git/index &&
git --no-optional-locks status &&
- test-tool chmtime --get .git/index >out &&
- grep ^1234567890 out &&
+ test_is_magic_mtime .git/index &&
git status &&
- test-tool chmtime --get .git/index >out &&
- ! grep ^1234567890 out
+ ! test_is_magic_mtime .git/index
'
test_done