When fetching or pulling from git repositories, or cloning a repository, I get to this point:
remote: Counting objects: 6666, done.
remote: Compressing obje
On Mac, git fetch should be more resistant to this kind of issue, with Git 2.22 (Q2 2019): On platforms where "git fetch" is killed with SIGPIPE (e.g. OSX), the upload-pack that runs on the other end that hangs up after detecting an error could cause "git fetch" to die with a signal, which led to a flakey test.
"git fetch" now ignores SIGPIPE during the network portion of its operation (this is not a problem as we check the return status from our write(2)s).
See commit 1435889 (03 Mar 2019), and commit 37c8001 (05 Mar 2019) by Jeff King (peff).
(Merged by Junio C Hamano -- gitster -- in commit 27cdbdd, 20 Mar 2019)
fetch: ignoreSIGPIPEduring network operationThe default
SIGPIPEbehavior can be useful for a command that generates a lot of output: if the receiver of our output goes away, we'll be notified asynchronously to stop generating it (typically by killing the program).But for a command like
fetch, which is primarily concerned with receiving data and writing it to disk, an unexpectedSIGPIPEcan be awkward. We're already checking the return value of all of ourwrite()calls, and dying due to the signal takes away our chance to gracefully handle the error.On Linux, we wouldn't generally see
SIGPIPEat all during fetch. If the other side of the network connection hangs up, we'll seeECONNRESET.
But on OS X, we get aSIGPIPE, and the process is killed.Let's ignore
SIGPIPEduring the network portion of the fetch, which will cause ourwrite()to returnEPIPE, giving us consistent behavior across platforms.