libgit2

git_obj_hash

Version:

Determine the object-ID (sha1 hash) of the given git_rawobj.

The input obj must be a valid loose object type and the data pointer must not be NULL, unless the len field is also zero.

Signature

int git_obj_hash(git_oid *id, git_rawobj *obj);

Parameters

In
id

the resulting object-ID.

In
obj

the object whose hash is to be determined.

Returns

int
  • GIT_SUCCESS if the object-ID was correctly determined.
  • GIT_ERROR if the given object is malformed.

Versions