class
Agate::BranchCollection
- Agate::BranchCollection
- Reference
- Object
Overview
An Enumerable collection of branches in a repository.
Accessed via Repository#branches.
Included Modules
- Enumerable(Agate::Branch)
Defined in:
agate/branch_collection.crInstance Method Summary
-
#[](name : String, type : Branch::Filter = Branch::Filter::Local) : Branch
Looks up a branch by name.
-
#[]?(name : String, type : Branch::Filter = Branch::Filter::Local) : Branch | Nil
Looks up a branch by name, returning nil if not found.
-
#create(name : String, target : Commit, force = false) : Branch
Creates a new branch pointing at the given commit.
-
#delete(name : String, type : Branch::Filter = Branch::Filter::Local) : Nil
Deletes a branch by name.
-
#each(filter : Branch::Filter = Branch::Filter::All, & : Branch -> ) : Nil
Iterates over all branches matching the given filter.
-
#each_name(filter : Branch::Filter = Branch::Filter::All, & : String -> ) : Nil
Iterates over branch names matching the given filter.
-
#exist?(name : String, type : Branch::Filter = Branch::Filter::Local) : Bool
Returns true if a branch with the given name exists.
-
#rename(old_name : String, new_name : String, force = false) : Branch
Renames a branch.
Instance Method Detail
Looks up a branch by name. Raises on failure.
Looks up a branch by name, returning nil if not found.
Creates a new branch pointing at the given commit.
Deletes a branch by name.
Iterates over all branches matching the given filter.
Iterates over branch names matching the given filter.
Returns true if a branch with the given name exists.
Renames a branch.