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.
Repository pointer
0 on success, git_error_code.GIT_EUNBORNBRANCH when HEAD points to a non existing branch or an error code
See Implementation
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.