Execute pre-receive hook

This patch work in my project.
Is this similar to what git does? It seems a bit odd to only report the error for the last ref.

Also, unpacking hasn't happened at this point, so I don't think it is reasonable to claim it went okay.