(owner, repository, sha string)
| 177 | } |
| 178 | |
| 179 | func (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 | } |
nothing calls this directly
no test coverage detected