git_repository_detach_head

Detach the HEAD.

If the HEAD is already detached and points to a Commit, 0 is returned.

If the HEAD is already detached and points to a Tag, the HEAD is updated into making it point to the peeled Commit, and 0 is returned.

If the HEAD is already detached and points to a non commitish, the HEAD is unaltered, and -1 is returned.

Otherwise, the HEAD will be detached and point to the peeled Commit.

extern (C) nothrow @nogc
int
git_repository_detach_head

Parameters

repo libgit2_d.types.git_repository*

Repository pointer

Return Value

Type: int

0 on success, git_error_code.GIT_EUNBORNBRANCH when HEAD points to a non existing branch or an error code

Meta