class Agate::BranchCollection

Overview

An Enumerable collection of branches in a repository. Accessed via Repository#branches.

Included Modules

Defined in:

agate/branch_collection.cr

Instance Method Summary

Instance Method Detail

def [](name : String, type : Branch::Filter = Branch::Filter::Local) : Branch #

Looks up a branch by name. Raises on failure.


[View source]
def []?(name : String, type : Branch::Filter = Branch::Filter::Local) : Branch | Nil #

Looks up a branch by name, returning nil if not found.


[View source]
def create(name : String, target : Commit, force = false) : Branch #

Creates a new branch pointing at the given commit.


[View source]
def delete(name : String, type : Branch::Filter = Branch::Filter::Local) : Nil #

Deletes a branch by name.


[View source]
def each(filter : Branch::Filter = Branch::Filter::All, & : Branch -> ) : Nil #

Iterates over all branches matching the given filter.


[View source]
def each_name(filter : Branch::Filter = Branch::Filter::All, & : String -> ) : Nil #

Iterates over branch names matching the given filter.


[View source]
def exist?(name : String, type : Branch::Filter = Branch::Filter::Local) : Bool #

Returns true if a branch with the given name exists.


[View source]
def rename(old_name : String, new_name : String, force = false) : Branch #

Renames a branch.


[View source]