4. Branch

These methods allows user to work with git branches of a given repository.

These help to create, delete, iterate over list of branches and setting upstreams for a branch.

4.1. branch_create

parameters Returns
luagit2_repository luagit2_reference
branch_name (string)
luagit2_commit
force (int)
  1. luagit2_repository : The repository to create a new branch in.
  2. branch_name : the name of new branch to create .
  3. luagit2_commit : the last commit using which the branch will be created.
  4. force : integer equivalent of boolean whether or not force create a new branch.

4.2. branch_create_from_annotated

parameters Returns
luagit2_repository luagit2_reference
branch_name (string)
luagit2_annotated_commit
force (int)
  1. luagit2_repository : The repository to create a new branch in.
  2. branch_name : the name of new branch to create .
  3. luagit2_annotated_commit : the annptated commit using which the branch will be created.
  4. force : integer equivalent of boolean whether or not force create a new branch.

4.3. branch_delete

parameters Returns
luagit2_reference None
  1. luagit2_reference : The reference for the branch which is to be deleted.

4.4. branch_is_checked_out

parameters Returns
luagit2_reference Boolean
  1. luagit2_reference : The reference for the branch which to check.

4.5. branch_is_head

parameters Returns
luagit2_reference Boolean
  1. luagit2_reference : The reference for the branch which to check.

4.6. branch_iterator_new

parameters Returns
luagit2_repository luagit2_branch_iterator
luagit2_branch_type
  1. luagit2_repository : The repository to look for the list of branches.
  2. luagit2_branch_type : the type of branches to look .It can be either LOCAL or REMOTE. It can be created using luagit2’s branch helper methods get_type_GIT_BRANCH_LOCAL & get_type_GIT_BRANCH_REMOTE .

4.7. branch_lookup

parameters Returns
luagit2_repository luagit2_reference
branch_name (string)
luagit2_branch_type
  1. luagit2_repository : The repository to look into for the given branch.
  2. branch_name : the path to the blob in repository .
  3. luagit2_branch_type : the type of branches to look . It can be either LOCAL or REMOTE. It can be created using luagit2’s branch helper methods get_type_GIT_BRANCH_LOCAL & get_type_GIT_BRANCH_REMOTE .

4.8. branch_move

parameters Returns
luagit2_reference luagit2_reference
new_branch_name (string)
force (int)
  1. luagit2_reference : The reference for the branch which is to be moved to a new name.
  2. new_branch_name : The new branch name.
  3. force : integer equivalent of bool to force branch moving.

4.9. branch_name

parameters Returns
luagit2_reference String (name)
  1. luagit2_reference : The reference for the branch whose name is to be found.

4.10. branch_next

parameters Returns
luagit2_branch_type luagit2_reference
luagit2_branch_iterator
  1. luagit2_branch_type : The type of branches to look .It can be either LOCAL or REMOTE. It can be created using luagit2’s branch helper methods get_type_GIT_BRANCH_LOCAL & get_type_GIT_BRANCH_REMOTE .
  2. luagit2_branch_iterator : The branch iterator that contains list of all branches .

4.11. branch_set_upstream

parameters Returns
luagit2_reference None
upstream_name(string)
  1. luagit2_reference : The reference for the branch.
  2. upstream_name : The upstream’s name.

4.12. branch_upstream

parameters Returns
luagit2_reference luagit2_reference
  1. luagit2_reference : The reference for the branch whose upstream branch is to be found.