]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t1400: have fifo test clean after itself
authorJunio C Hamano <gitster@pobox.com>
Wed, 10 Jun 2026 21:39:08 +0000 (14:39 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 11 Jun 2026 12:34:40 +0000 (05:34 -0700)
One test in this script creates a pair of FIFOs, "in" and "out",
that are named so generically that later tests may be tempted to use
them.  By the time those later tests run a command with its output
redirected to the file (e.g., "git foobar >out"), however, nobody is
reading from the lingering FIFO, and the test gets blocked forever.

Clean them up when the test finishes.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t1400-update-ref.sh

index db7f5444da2162155a2b35b0d1717fc5fc9d77d8..477af544bc2a467aaba27a4d380d1ced7a3acc7d 100755 (executable)
@@ -1610,6 +1610,7 @@ test_expect_success 'transaction cannot restart ongoing transaction' '
 '
 
 test_expect_success PIPE 'transaction flushes status updates' '
+       test_when_finished "rm -f in out" &&
        mkfifo in out &&
        (git update-ref --stdin <in >out &) &&