When opening a repository with git_repository_open_bare, the oid_type isn't set. This causes all the code that relies on it (like loading packed refs) to fail, since GIT_OID_SHA1 has value of 1, but the memory contents will be 0 if not set to any value.