libgit2

git_branch_is_checked_out

Version:

Determine if any HEAD points to the current branch

This will iterate over all known linked repositories (usually in the form of worktrees) and report whether any HEAD is pointing at the current branch.

Signature

int git_branch_is_checked_out(const git_reference *branch);

Parameters

In
branch

A reference to a local branch.

Returns

int

1 if branch is checked out, 0 if it isn't, an error code otherwise.

Versions