]> git.ipfire.org Git - thirdparty/git.git/commit
t-reftable-stack: use Git's tempfile API instead of mkstemp()
authorChandra Pratap <chandrapratap3519@gmail.com>
Sun, 8 Sep 2024 04:05:58 +0000 (09:35 +0530)
committerJunio C Hamano <gitster@pobox.com>
Sun, 8 Sep 2024 20:24:03 +0000 (13:24 -0700)
commit476abc39babbdc67782ad04c4fa1d965ca8ff34d
tree306ff7576f0fbf55ff188debe4685546d9279156
parente4e384f68d2e9c2fd726bfc9d16f2359c0dda69c
t-reftable-stack: use Git's tempfile API instead of mkstemp()

Git's tempfile API defined by $GIT_DIR/tempfile.{c,h} provides
a unified interface for tempfile operations. Since reftable/stack.c
uses this API for all its tempfile needs instead of raw functions
like mkstemp(), make the ported stack test strictly use Git's
tempfile API as well.

A bigger benefit is the fact that we know to clean up the tempfile
in case the test fails because it gets registered and pruned via a
signal handler.

Mentored-by: Patrick Steinhardt <ps@pks.im>
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Chandra Pratap <chandrapratap3519@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/unit-tests/t-reftable-stack.c