Skip to content

Commit

Permalink
Merge branch 'pw/diff-no-index-from-named-pipes' into next
Browse files Browse the repository at this point in the history
Test updates.

* pw/diff-no-index-from-named-pipes:
  t4053: avoid writing to unopened pipe
  t4053: avoid race when killing background processes
  • Loading branch information
gitster committed Aug 14, 2023
2 parents ba45da5 + e5cb1e3 commit 6600a9f
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions t/t4053-diff-no-index.sh
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,6 @@ test_expect_success 'diff --no-index refuses to diff stdin and a directory' '
test_expect_success PIPE 'diff --no-index refuses to diff a named pipe and a directory' '
test_when_finished "rm -f pipe" &&
mkfifo pipe &&
{
(>pipe) &
} &&
test_when_finished "kill $!" &&
test_must_fail git diff --no-index -- pipe a 2>err &&
grep "fatal: cannot compare a named pipe to a directory" err
'
Expand All @@ -248,11 +244,11 @@ test_expect_success PIPE,SYMLINKS 'diff --no-index reads from pipes' '
{
(test_write_lines a b c >old) &
} &&
test_when_finished "! kill $!" &&
test_when_finished "kill $! || :" &&
{
(test_write_lines a x c >new) &
} &&
test_when_finished "! kill $!" &&
test_when_finished "kill $! || :" &&
cat >expect <<-EOF &&
diff --git a/old b/new-link
Expand Down

0 comments on commit 6600a9f

Please sign in to comment.