libgit2

git_repository_head_orphan

Version:

Check if the current branch is an orphan

An orphan branch is one named from HEAD but which doesn't exist in the refs namespace, because it doesn't have any commit to point to.

Signature

int git_repository_head_orphan(git_repository *repo);

Parameters

In
repo

Repo to test

Returns

int

1 if the current branch is an orphan, 0 if it's not; error code if there was an error

Versions