libgit2

git_reference_target

Version:

Get the OID pointed to by a direct reference.

Only available if the reference is direct (i.e. an object id reference, not a symbolic one).

To find the OID of a symbolic ref, call git_reference_resolve() and then this function (or maybe use git_reference_name_to_id() to directly resolve a reference name all the way through to an OID).

Signature

const git_oid *git_reference_target(const git_reference *ref);

Parameters

In
ref

The reference

Returns

a pointer to the oid if available, NULL otherwise

Versions