]> git.ipfire.org Git - thirdparty/git.git/commit
t: add a test helper to truncate files
authorbrian m. carlson <bk2204@github.com>
Thu, 12 Oct 2023 16:09:29 +0000 (16:09 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 13 Oct 2023 20:33:35 +0000 (13:33 -0700)
commit678eb55f5da174fce21f686f0073d56904c081c9
tree6447c30830961b5a512e2e710770c4a609fd8355
parent43c8a30d150ecede9709c1f2527c8fba92c65f40
t: add a test helper to truncate files

In a future commit, we're going to work with some large files which will
be at least 4 GiB in size.  To take advantage of the sparseness
functionality on most Unix systems and avoid running the system out of
disk, it would be convenient to use truncate(2) to simply create a
sparse file of sufficient size.

However, the GNU truncate(1) utility isn't portable, so let's write a
tiny test helper that does the work for us.

Signed-off-by: brian m. carlson <bk2204@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile
t/helper/test-tool.c
t/helper/test-tool.h
t/helper/test-truncate.c [new file with mode: 0644]