In my project, I have a git pre-push hook that run test & lint on my code before push. It can take a lot of time (5 min for ex) and in that case, even is hook is successful, code is not pushed to Bitbucket with error "error: failed to push some refs to 'bitbucket.org:....".
If I take a look to my hook logs, I see this log between 2 tests:
Connection to bitbucket.org closed by remote host.
Why connection to remote is open at start of the hook ? There is a way to change this behavior (I think Bitbucket socket is close in remote due to some timeout) ?