// AddBranch adds a new branch to the model.
778196
func (c *Client) AddBranch(branchName string) error {
	var result params.ErrorResult
	err := c.facade.FacadeCall("AddBranch", argForBranch(branchName), &result)
	if err != nil {
		return errors.Trace(err)
	}
	if result.Error != nil {
		return errors.Trace(result.Error)
	}
	return nil
}
707262
func (s *DeleteBranchInput) SetBranchName(v string) *DeleteBranchInput {
	s.BranchName = &v
	return s
}
1229110
func getBranch(projects []che.WorkspaceProject, codebaseURL string) string {
	for _, p := range projects {
		if p.Source.Location == codebaseURL {
			return p.Source.Parameters.Branch
		}
	}
	return ""
}
471741
func (cmd *PageCommand) PrintBranch(w io.Writer, buf []byte) error {
	p := (*page)(unsafe.Pointer(&buf[0]))

	// Print number of items.
	fmt.Fprintf(w, "Item Count: %d\n", p.count)
	fmt.Fprintf(w, "\n")

	// Print each key/value.
	for i := uint16(0); i < p.count; i++ {
		e := p.branchPageElement(i)

		// Format key as string.
		var k string
		if isPrintable(string(e.key())) {
			k = fmt.Sprintf("%q", string(e.key()))
		} else {
			k = fmt.Sprintf("%x", string(e.key()))
		}

		fmt.Fprintf(w, "%s: <pgid=%d>\n", k, e.pgid)
	}
	fmt.Fprintf(w, "\n")
	return nil
}
1042010
func (m *MockCommitCommandAPI) CommitBranch(arg0 string) (int, error) {
	ret := m.ctrl.Call(m, "CommitBranch", arg0)
	ret0, _ := ret[0].(int)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
950836
func (s *GetBranchOutput) SetBranch(v *Branch) *GetBranchOutput {
	s.Branch = v
	return s
}
213623
func (p *PagesSource) GetBranch() string {
	if p == nil || p.Branch == nil {
		return ""
	}
	return *p.Branch
}
1186289
func (r *Repository) DeleteBranch(name string) error {
	cfg, err := r.Storer.Config()
	if err != nil {
		return err
	}

	if _, ok := cfg.Branches[name]; !ok {
		return ErrBranchNotFound
	}

	delete(cfg.Branches, name)
	return r.Storer.SetConfig(cfg)
}
459548
func (c *ModelCommandBase) SetActiveBranch(branchName string) error {
	_, modelDetails, err := c.ModelDetails()
	if err != nil {
		return errors.Annotate(err, "getting model details")
	}
	modelDetails.ActiveBranch = branchName
	if err = c.store.UpdateModel(c._controllerName, c._modelName, *modelDetails); err != nil {
		return err
	}
	c._activeBranch = branchName
	return nil
}
984856
func (s *RepositoryTrigger) SetBranches(v []*string) *RepositoryTrigger {
	s.Branches = v
	return s
}
1121925
func (r *RepositoryContentFileOptions) GetBranch() string {
	if r == nil || r.Branch == nil {
		return ""
	}
	return *r.Branch
}
524301
func (md *MDOpsStandard) ResolveBranch(
	ctx context.Context, id tlf.ID, bid kbfsmd.BranchID, _ []kbfsblock.ID,
	rmd *RootMetadata, verifyingKey kbfscrypto.VerifyingKey) (
	ImmutableRootMetadata, error) {
	// Put the MD first.
	irmd, err := md.Put(ctx, rmd, verifyingKey, nil, keybase1.MDPriorityNormal)
	if err != nil {
		return ImmutableRootMetadata{}, err
	}

	// Prune the branch ia the journal, if there is one.  If the
	// client fails before this is completed, we'll need to check for
	// resolutions on the next restart (see KBFS-798).
	err = md.PruneBranch(ctx, id, bid)
	if err != nil {
		return ImmutableRootMetadata{}, err
	}
	return irmd, nil
}
594032
func ValidateBranchName(name string) error {
	if name == "" {
		return errors.NotValidf("empty branch name")
	}
	if name == GenerationMaster {
		return errors.NotValidf("branch name %q", GenerationMaster)
	}
	return nil
}
1313723
func (repo *Repository) DeleteBranch(name string, opts DeleteBranchOptions) error {
	return DeleteBranch(repo.Path, name, opts)
}
1146727
func (s *DeleteJobInput) SetBranchName(v string) *DeleteJobInput {
	s.BranchName = &v
	return s
}
444379
func (s *PutFileInput) SetBranchName(v string) *PutFileInput {
	s.BranchName = &v
	return s
}
234593
func (md *RootMetadata) SetBranchID(bid kbfsmd.BranchID) {
	md.bareMd.SetBranchID(bid)
}