Read the header of an object from the database, without reading its full contents.
The header includes the length and the type of an object.
Note that most backends do not support reading only the header of an object, so the whole object will be read and then the header will be returned.
pointer where to store the length
0 if the object was read, GIT_ENOTFOUND if the object is not in the database.