t/helper/test-truncate: close file descriptor after truncation

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>
This commit is contained in:
Hoyoung Lee 2025-07-22 17:41:01 +00:00 committed by Junio C Hamano
parent 16bd9f20a4
commit 8cc19250b3

View File

@ -21,5 +21,8 @@ int cmd__truncate(int argc, const char **argv)
if (ftruncate(fd, (off_t) sz) < 0)
die_errno("failed to truncate file");
close(fd);
return 0;
}