MCPcopy Create free account
hub / github.com/monitoror/monitoror / GetCommit

Method GetCommit

monitorables/github/api/repository/api.go:179–199  ·  view source on GitHub ↗
(owner, repository, sha string)

Source from the content-addressed store, hash-verified

177}
178
179func (gr *githubRepository) GetCommit(owner, repository, sha string) (*models.Commit, error) {
180 commit, _, err := gr.gitService.GetCommit(context.TODO(), owner, repository, sha)
181 if err != nil {
182 return nil, err
183 }
184
185 result := &models.Commit{
186 SHA: sha,
187 }
188
189 if commit.GetAuthor() != nil {
190 result.Author.Name = commit.GetAuthor().GetName()
191 result.Author.AvatarURL = gravatar.GetGravatarURL(commit.GetAuthor().GetEmail())
192
193 if result.Author.Name == "" {
194 result.Author.Name = commit.GetAuthor().GetLogin()
195 }
196 }
197
198 return result, nil
199}

Callers

nothing calls this directly

Calls 2

GetGravatarURLFunction · 0.92
GetCommitMethod · 0.65

Tested by

no test coverage detected