// GetCommitID returns the CommitID field if it's non-nil, zero value otherwise.
492687
func (p *PullRequestReviewRequest) GetCommitID() string {
	if p == nil || p.CommitID == nil {
		return ""
	}
	return *p.CommitID
}
249445
func (s *BranchInfo) SetCommitId(v string) *BranchInfo {
	s.CommitId = &v
	return s
}
942045
func (repo *Repository) GetBranchCommit(name string) (*Commit, error) {
	commitID, err := repo.GetBranchCommitID(name)
	if err != nil {
		return nil, err
	}
	return repo.GetCommit(commitID)
}
382187
func (g *GistCommit) GetNodeID() string {
	if g == nil || g.NodeID == nil {
		return ""
	}
	return *g.NodeID
}
100856
func (s *GetFolderOutput) SetCommitId(v string) *GetFolderOutput {
	s.CommitId = &v
	return s
}
276702
func (g *GPGKey) GetID() int64 {
	if g == nil || g.ID == nil {
		return 0
	}
	return *g.ID
}
423417
func (s *Source) GetID() int64 {
	if s == nil || s.ID == nil {
		return 0
	}
	return *s.ID
}
716817
func (t *Timeline) GetCommitID() string {
	if t == nil || t.CommitID == nil {
		return ""
	}
	return *t.CommitID
}
767158
func (r *RepositoryComment) GetID() int64 {
	if r == nil || r.ID == nil {
		return 0
	}
	return *r.ID
}
45072
func (d *Deployment) GetID() int64 {
	if d == nil || d.ID == nil {
		return 0
	}
	return *d.ID
}
901414
func (c *CombinedStatus) GetCommitURL() string {
	if c == nil || c.CommitURL == nil {
		return ""
	}
	return *c.CommitURL
}
1070720
func GetDiffCommit(repoPath, commitID string, maxLines, maxLineCharacteres, maxFiles int) (*Diff, error) {
	return GetDiffRange(repoPath, "", commitID, maxLines, maxLineCharacteres, maxFiles)
}
801884
func (r *RepoStatus) GetID() int64 {
	if r == nil || r.ID == nil {
		return 0
	}
	return *r.ID
}
1024531
func (s *GetCommitInput) SetCommitId(v string) *GetCommitInput {
	s.CommitId = &v
	return s
}
441145
func (s *RepositoriesService) GetCommitRaw(ctx context.Context, owner string, repo string, sha string, opt RawOptions) (string, *Response, error) {
	u := fmt.Sprintf("repos/%v/%v/commits/%v", owner, repo, sha)
	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return "", nil, err
	}

	switch opt.Type {
	case Diff:
		req.Header.Set("Accept", mediaTypeV3Diff)
	case Patch:
		req.Header.Set("Accept", mediaTypeV3Patch)
	default:
		return "", nil, fmt.Errorf("unsupported raw type %d", opt.Type)
	}

	var buf bytes.Buffer
	resp, err := s.client.Do(ctx, req, &buf)
	if err != nil {
		return "", resp, err
	}

	return buf.String(), resp, nil
}
73644
func (r *RepositoryRelease) GetID() int64 {
	if r == nil || r.ID == nil {
		return 0
	}
	return *r.ID
}
1158770
func (repo *Repository) GetCommitByPath(relpath string) (*Commit, error) {
	stdout, err := NewCommand("log", "-1", _PRETTY_LOG_FORMAT, "--", relpath).RunInDirBytes(repo.Path)
	if err != nil {
		return nil, err
	}

	commits, err := repo.parsePrettyFormatLogToList(stdout)
	if err != nil {
		return nil, err
	}
	return commits.Front().Value.(*Commit), nil
}