git_branch_lookup

Lookup a branch by its name in a repository.

The generated reference must be freed by the user. The branch name will be checked for validity.

@see git_tag_create for rules about valid names.

Parameters

out_ libgit2_d.types.git_reference**

pointer to the looked-up branch reference

repo libgit2_d.types.git_repository*

the repository to look up the branch

branch_name const(char)*

Name of the branch to be looked-up; this name is validated for consistency.

branch_type libgit2_d.types.git_branch_t

Type of the considered branch. This should be valued with either git_branch_t.GIT_BRANCH_LOCAL or git_branch_t.GIT_BRANCH_REMOTE.

Return Value

Type: int

0 on success; git_error_code.GIT_ENOTFOUND when no matching branch exists, git_error_code.GIT_EINVALIDSPEC, otherwise an error code.

Meta