libgit2

git_reference_set_oid

Version:

Set the OID target of a reference.

The reference must be a direct reference, otherwise this method will fail.

The reference will be automatically updated in memory and on disk.

Signature

int git_reference_set_oid(git_reference *ref, const git_oid *id);

Parameters

In
ref

The reference

In
id

The new target OID for the reference

Returns

int

0 on success; error code otherwise

Versions