git_reference_set_target

Conditionally create a new reference with the same name as the given reference but a different OID target. The reference must be a direct reference, otherwise this will fail.

The new reference will be written to disk, overwriting the given reference.

extern (C) nothrow @nogc
int
git_reference_set_target

Parameters

out_ libgit2_d.types.git_reference**

Pointer to the newly created reference

ref_ libgit2_d.types.git_reference*

The reference

id const(libgit2_d.oid.git_oid)*

The new target OID for the reference

log_message const(char)*

The one line long message to be appended to the reflog

Return Value

Type: int

0 on success, git_error_code.GIT_EMODIFIED if the value of the reference has changed since it was read, or an error code

Meta