The git-hooks pre-push documentation states that the first line of stdin will be populated with the local ref and sha, and the remote ref and sha as such:
<local ref> SP <local sha1> SP <remote ref> SP <remote sha1> LF
However, my simple pre-push script:
#!/bin/bash
echo "params=[$@]"
read line
echo "stdin=[$line]"
exit 1
returns the following output when a $git push is run:
params=[origin [url]:[branch].git]
stdin=[]
error: failed to push some refs to '[remote]'
The parameters to the script are as specified in the documentation (name and path of the remote). The error is expected because my script exits with a status of 1. However, I can't seem to figure out why I'm not receiving the local and remote refs on stdin as specified by the documentation.
Is this a bug in git? Or, am I missing something?