mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-01 04:12:10 +00:00
Corrections following recommendations
This commit is contained in:
parent
81e5722bcc
commit
b7b30cd85e
5 changed files with 39 additions and 37 deletions
|
@ -16,26 +16,6 @@ import (
|
|||
"github.com/gogits/gogs/modules/setting"
|
||||
)
|
||||
|
||||
// ToApiBranch converts user to its API format.
|
||||
func ToApiBranch(b *models.Branch,c *git.Commit) *api.Branch {
|
||||
return &api.Branch{
|
||||
Name: b.Name,
|
||||
Commit: ToApiCommit(c),
|
||||
}
|
||||
}
|
||||
// ToApiCommit converts user to its API format.
|
||||
func ToApiCommit(c *git.Commit) *api.PayloadCommit {
|
||||
return &api.PayloadCommit{
|
||||
ID: c.ID.String(),
|
||||
Message: c.Message(),
|
||||
URL: "Not implemented",
|
||||
Author: &api.PayloadAuthor{
|
||||
Name: c.Committer.Name,
|
||||
Email: c.Committer.Email,
|
||||
/* UserName: c.Committer.UserName, */
|
||||
},
|
||||
}
|
||||
}
|
||||
// ToApiUser converts user to its API format.
|
||||
func ToApiUser(u *models.User) *api.User {
|
||||
return &api.User{
|
||||
|
@ -71,6 +51,28 @@ func ToApiRepository(owner *models.User, repo *models.Repository, permission api
|
|||
}
|
||||
}
|
||||
|
||||
// ToApiBranch converts user to its API format.
|
||||
func ToApiBranch(b *models.Branch,c *git.Commit) *api.Branch {
|
||||
return &api.Branch{
|
||||
Name: b.Name,
|
||||
Commit: ToApiCommit(c),
|
||||
}
|
||||
}
|
||||
|
||||
// ToApiCommit converts user to its API format.
|
||||
func ToApiCommit(c *git.Commit) *api.PayloadCommit {
|
||||
return &api.PayloadCommit{
|
||||
ID: c.ID.String(),
|
||||
Message: c.Message(),
|
||||
URL: "Not implemented",
|
||||
Author: &api.PayloadAuthor{
|
||||
Name: c.Committer.Name,
|
||||
Email: c.Committer.Email,
|
||||
/* UserName: c.Committer.UserName, */
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// ToApiPublicKey converts public key to its API format.
|
||||
func ToApiPublicKey(apiLink string, key *models.PublicKey) *api.PublicKey {
|
||||
return &api.PublicKey{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue