]> git.ipfire.org Git - thirdparty/git.git/commit
test-lib: introduce API for verifying file mtime
authorMarc Strapetz <marc.strapetz@syntevo.com>
Fri, 7 Jan 2022 11:17:28 +0000 (11:17 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 7 Jan 2022 20:37:30 +0000 (12:37 -0800)
commitab6245bdeed46e1ff3bd378690066abd2ed0f2ef
treeeff4125a81937777d716db8dc841d22d87ba3bb8
parentdcc0cd074f0c639a0df20461a301af6d45bd582e
test-lib: introduce API for verifying file mtime

Add functions `test_set_magic_mtime` and `test_is_magic_mtime` which can
be used to (re)set the mtime of a file to a predefined ("magic")
timestamp, then perform some operations and finally check for mtime
changes of the file.

The core implementation follows the suggestion from the
mailing list [1].

[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>
t/test-lib-functions.sh