libgit2

git_reference_reload

Version:

Reload a reference from disk

Reference pointers may become outdated if the Git repository is accessed simultaneously by other clients whilt the library is open.

This method forces a reload of the reference from disk, to ensure that the provided information is still reliable.

If the reload fails (e.g. the reference no longer exists on disk, or has become corrupted), an error code will be returned and the reference pointer will be invalidated.

Signature

int git_reference_reload(git_reference *ref);

Parameters

In
ref

The reference to reload

Returns

int

GIT_SUCCESS on success, or an error code

Versions