mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-01 04:12:10 +00:00
Near ready
This commit is contained in:
parent
566163ab82
commit
c11c3b6c11
5 changed files with 134 additions and 1 deletions
|
@ -10,11 +10,32 @@ import (
|
|||
"github.com/Unknwon/com"
|
||||
|
||||
api "github.com/gogits/go-gogs-client"
|
||||
"github.com/gogits/git-module"
|
||||
|
||||
"github.com/gogits/gogs/models"
|
||||
"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{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue