libgit2

git_reference_symbolic_set_target

Version:

Create a new reference with the same name as the given reference but a different symbolic target. The reference must be a symbolic reference, otherwise this will fail.

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

The target name will be checked for validity. See git_reference_create_symbolic() for rules about valid names.

Signature

int git_reference_symbolic_set_target(git_reference **out, git_reference *ref, const char *target);

Parameters

In
out

Pointer to the newly created reference

In
ref

The reference

const char *
In
target

The new target for the reference

Returns

int

0 on success, GIT_EINVALIDSPEC or an error code

Versions