git_reference_rename

Rename an existing reference.

This method works for both direct and symbolic references.

The new name will be checked for validity. See git_reference_symbolic_create() for rules about valid names.

If the force flag is not enabled, and there's already a reference with the given name, the renaming will fail.

IMPORTANT: The user needs to write a proper reflog entry if the reflog is enabled for the repository. We only rename the reflog if it exists.

extern (C) nothrow @nogc
int
git_reference_rename

Parameters

ref_ libgit2_d.types.git_reference*

The reference to rename

new_name const(char)*

The new name for the reference

force int

Overwrite an existing 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_EINVALIDSPEC, git_error_code.GIT_EEXISTS or an error code

Meta