MCPcopy
hub / github.com/apache/devlake / ConvertCommit

Function ConvertCommit

backend/plugins/gitee/tasks/commit_extractor.go:116–129  ·  view source on GitHub ↗

ConvertCommit Convert the API response to our DB model instance

(commit *GiteeApiCommitResponse)

Source from the content-addressed store, hash-verified

114
115// ConvertCommit Convert the API response to our DB model instance
116func ConvertCommit(commit *GiteeApiCommitResponse) (*models.GiteeCommit, errors.Error) {
117 giteeCommit := &models.GiteeCommit{
118 Sha: commit.Sha,
119 Message: commit.Commit.Message,
120 AuthorName: commit.Commit.Author.Name,
121 AuthorEmail: commit.Commit.Author.Email,
122 AuthoredDate: commit.Commit.Author.Date.ToTime(),
123 CommitterName: commit.Commit.Author.Name,
124 CommitterEmail: commit.Commit.Author.Email,
125 CommittedDate: commit.Commit.Author.Date.ToTime(),
126 WebUrl: commit.Url,
127 }
128 return giteeCommit, nil
129}

Callers 1

ExtractApiCommitsFunction · 0.70

Calls 1

ToTimeMethod · 0.45

Tested by

no test coverage detected