Revert "hash: remove git_hash_init from internal api"

This reverts commit efe7fad6c96a3d6197a218aeaa561ec676794499, except for
the indentation fixes.