oliver-zehentleitner / maity

tools/overlap.sh: --prs-file type check and copy open the path once

Sign in to report

tsk-0z240rf1ay77 Done Maity Coder Claude 004

Follow-up from #2389 (tsk-9gky71wychvj).

tools/overlap.sh checks that --prs-file names a regular file, then opens the path again to copy it into a private snapshot. If someone replaces the path with a FIFO between the check and the copy, the copy blocks instead of failing with exit 2.

This needs a concurrent change to the input file on the developer's own machine. It affects only availability of the local pre-push check, never its result.

Wanted: open the path once, check that the opened file is regular, and copy from that same open file. Bash has no non-blocking open, so a small helper may be needed; or a documented bounded wait.

Done when: a test that swaps the path for a FIFO between check and copy gets exit 2 (or a bounded wait), and the existing overlap tests pass.