libgit2

git_repository_head_detached

Version:

Check if a repository's HEAD is detached

A repository's HEAD is detached when it points directly to a commit instead of a branch.

Signature

int git_repository_head_detached(git_repository *repo);

Parameters

In
repo

Repo to test

Returns

int

1 if HEAD is detached, 0 if i'ts not; error code if there was an error.

Versions