// SetBranch sets the Branch field's value.
12407
func (s *GitConfig) SetBranch(v string) *GitConfig {
	s.Branch = &v
	return s
}
987959
func (s *GetJobInput) SetBranchName(v string) *GetJobInput {
	s.BranchName = &v
	return s
}
1039493
func (s *CreateSubnetGroupOutput) SetSubnetGroup(v *SubnetGroup) *CreateSubnetGroupOutput {
	s.SubnetGroup = v
	return s
}
1079773
func (s *CreateWebhookInput) SetBranchFilter(v string) *CreateWebhookInput {
	s.BranchFilter = &v
	return s
}
922483
func (s *DeleteBranchOutput) SetBranch(v *Branch) *DeleteBranchOutput {
	s.Branch = v
	return s
}
643224
func (s *Webhook) SetBranchFilter(v string) *Webhook {
	s.BranchFilter = &v
	return s
}
701589
func (s *UpdateDefaultBranchInput) SetDefaultBranchName(v string) *UpdateDefaultBranchInput {
	s.DefaultBranchName = &v
	return s
}
388704
func (c *Client) CommitBranch(branchName string) (int, error) {
	var result params.IntResult
	err := c.facade.FacadeCall("CommitBranch", argForBranch(branchName), &result)
	if err != nil {
		return 0, errors.Trace(err)
	}
	if result.Error != nil {
		return 0, errors.Trace(result.Error)
	}
	return result.Result, nil
}
444379
func (s *PutFileInput) SetBranchName(v string) *PutFileInput {
	s.BranchName = &v
	return s
}
928662
func (s *CreateBranchInput) SetBranchName(v string) *CreateBranchInput {
	s.BranchName = &v
	return s
}
984856
func (s *RepositoryTrigger) SetBranches(v []*string) *RepositoryTrigger {
	s.Branches = v
	return s
}
141688
func (api *API) TrackBranch(arg params.BranchTrackArg) (params.ErrorResults, error) {
	isModelAdmin, err := api.hasAdminAccess()
	if err != nil {
		return params.ErrorResults{}, errors.Trace(err)
	}
	if !isModelAdmin && !api.isControllerAdmin {
		return params.ErrorResults{}, common.ErrPerm
	}

	branch, err := api.model.Branch(arg.BranchName)
	if err != nil {
		return params.ErrorResults{}, errors.Trace(err)
	}

	result := params.ErrorResults{
		Results: make([]params.ErrorResult, len(arg.Entities)),
	}
	for i, entity := range arg.Entities {
		tag, err := names.ParseTag(entity.Tag)
		if err != nil {
			result.Results[i].Error = common.ServerError(err)
			continue
		}
		switch tag.Kind() {
		case names.ApplicationTagKind:
			result.Results[i].Error = common.ServerError(branch.AssignAllUnits(tag.Id()))
		case names.UnitTagKind:
			result.Results[i].Error = common.ServerError(branch.AssignUnit(tag.Id()))
		default:
			result.Results[i].Error = common.ServerError(
				errors.Errorf("expected names.UnitTag or names.ApplicationTag, got %T", tag))
		}
	}
	return result, nil
}
581769
func (i *IdentifierNode) SetTree(t *Tree) *IdentifierNode {
	i.tr = t
	return i
}
1274964
func (s *Tag) SetPropagateAtLaunch(v bool) *Tag {
	s.PropagateAtLaunch = &v
	return s
}
372300
func gitBranch(path string) (string, error) {
	var stderr, stdout bytes.Buffer

	cmd := exec.Command("git", "symbolic-ref", "--short", "HEAD")
	cmd.Dir = path
	cmd.Stdout = &stdout
	cmd.Stderr = &stderr
	if err := cmd.Run(); err != nil {
		if strings.Contains(stderr.String(), ignorableDetachedHeadError) {
			return "", nil
		} else {
			return "",
				fmt.Errorf("error getting git branch: %s\nstdout: %s\nstderr: %s",
					err, stdout.String(), stderr.String())
		}
	}

	branch := strings.TrimSpace(stdout.String())

	return branch, nil
}
585424
func (st *State) Branch(name string) (*Generation, error) {
	doc, err := st.getBranchDoc(name)
	if err != nil {
		return nil, errors.Trace(err)
	}
	return newGeneration(st, doc), nil
}
87349
func (s *UpdateAutoScalingGroupInput) SetLaunchTemplate(v *LaunchTemplateSpecification) *UpdateAutoScalingGroupInput {
	s.LaunchTemplate = v
	return s
}