aboutsummaryrefslogtreecommitdiffstats
path: root/t/helper/test-truncate.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2025-07-22t/helper/test-truncate: close file descriptor after truncationHoyoung Lee1-0/+3
Fix a resource leak where the file descriptor was not closed after truncating a file in t/helper/test-truncate.c. Signed-off-by: Hoyoung Lee <lhywkd22@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-10-13t: add a test helper to truncate filesbrian m. carlson1-0/+25
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>