2.4 Branch
(require libgit2/include/branch) | package: libgit2 |
procedure
(git_branch_create repo branch_name target force) → reference? repo : repository? branch_name : string? target : commit? force : boolean?
A new direct reference will be created pointing to this target commit. If force is true and a reference already exists with the given name, it’ll be replaced.
The returned reference must be freed by the user.
The branch name will be checked for validity. See git_tag_create() for rules about valid names.
procedure
(git_branch_create_from_annotated repository branch_name commit force) → reference? repository : repository? branch_name : string? commit : annotated_commit? force : boolean?
This behaves like git_branch_create() but takes an annotated commit, which lets you specify which extended sha syntax string was specified by a user, allowing for more exact reflog messages.
See the documentation for git_branch_create().
procedure
(git_branch_delete branch) → integer?
branch : reference?
If the branch is successfully deleted, the passed reference object will be invalidated. The reference must be freed manually by the user.
procedure
(git_branch_is_head branch) → boolean?
branch : reference?
procedure
(git_branch_iterator_free iter) → void?
iter : branch_iterator?
procedure
(git_branch_iterator_new repo list_flags) → branch_iterator?
repo : repository? list_flags : git_branch_t
procedure
(git_branch_lookup repo branch_name branch_type) → reference? repo : repository? branch_name : string? branch_type : git_branch_t
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.
procedure
(git_branch_move branch new_branch_name force) → reference? branch : reference? new_branch_name : string? force : boolean?
The new branch name will be checked for validity. See git_tag_create() for rules about valid names.
procedure
(git_branch_name ref) → string?
ref : reference?
The name of the branch matches the definition of the name for git_branch_lookup. That is, if the returned name is given to git_branch_lookup() then the reference is returned that was given to this function.
procedure
(git_branch_next out_type iter) → any
out_type : branch_t? iter : branch_iterator?
Returns (values repository? git_branch_t). See Multiple Values
procedure
(git_branch_set_upstream branch upstream_name) → integer? branch : reference? upstream_name : string?