Branch return a Branch if exists
(name string)
| 687 | |
| 688 | // Branch return a Branch if exists |
| 689 | func (r *Repository) Branch(name string) (*config.Branch, error) { |
| 690 | cfg, err := r.Config() |
| 691 | if err != nil { |
| 692 | return nil, err |
| 693 | } |
| 694 | |
| 695 | b, ok := cfg.Branches[name] |
| 696 | if !ok { |
| 697 | return nil, ErrBranchNotFound |
| 698 | } |
| 699 | |
| 700 | return b, nil |
| 701 | } |
| 702 | |
| 703 | // CreateBranch creates a new Branch |
| 704 | func (r *Repository) CreateBranch(c *config.Branch) error { |