git: Enable support for SHA256 object format in hooks
This MR fixes hooks to work with the SHA256 object format. This should enable a bunch of RPCs that write into repositories to start working, with one example being SSH-based pushes via SSHReceivePack.