[PATCH v3 2/4] t7508: fix bogus mtime verification
- From
Marc Strapetz via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Jan 6, 2022, 22:34 UTC
- Message-ID
- <d15a23cc8049b1f2f67b089d9edea0ce098065b3.1641508499.git.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.1105.v3.git.1641508499.gitgitgadget@gmail.com>
From: Marc Strapetz <marc.strapetz@syntevo.com>
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> --- t/t7508-status.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/t/t7508-status.sh b/t/t7508-status.sh index 05c6c02435d..b9efd2613d0 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
-- gitgitgadget