libgit2

git_repository_head_for_worktree

Version:

Retrieve the referenced HEAD for the worktree

Signature

int git_repository_head_for_worktree(git_reference **out, git_repository *repo, const char *name);

Parameters

In
out

pointer to the reference which will be retrieved

In
repo

a repository object

const char *
In
name

name of the worktree to retrieve HEAD for

Returns

int

0 when successful, error-code otherwise

Versions