Browse Source

fix some rename errors after merge

pull/2039/head
Kim Lindhardt Madsen 9 years ago
parent
commit
241ce8f976
  1. 4
      routers/api/v1/repo.go
  2. 10
      routers/api/v1/repo_commits.go
  3. 18
      routers/api/v1/repo_releases.go

4
routers/api/v1/repo.go

@ -159,10 +159,6 @@ func createRepo(ctx *middleware.Context, owner *models.User, opt api.CreateRepoO
ctx.JSON(201, ToApiRepository(owner, repo, api.Permission{true, true, true}))
}
func GetRepo(ctx *middleware.Context) {
ctx.JSON(200, ToApiRepository(ctx.Repo.Repository.Owner, ctx.Repo.Repository, api.Permission{}))
}
// https://github.com/kiliit/go-gogs-client/wiki/Repositories#create
func CreateRepo(ctx *middleware.Context, opt api.CreateRepoOption) {
// Shouldn't reach this condition, but just in case.

10
routers/api/v1/repo_commits.go

@ -11,7 +11,7 @@ import (
"github.com/gogits/gogs/modules/git"
"github.com/gogits/gogs/modules/log"
"github.com/gogits/gogs/modules/middleware"
"github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/modules/template"
)
func ToApiSignature(signature *git.Signature) *api.Signature {
@ -24,7 +24,7 @@ func ToApiSignature(signature *git.Signature) *api.Signature {
func ToApiCommit(commit *git.Commit) *api.Commit {
return &api.Commit{
ID: commit.Id.String(),
ID: commit.ID.String(),
Author: *ToApiSignature(commit.Author),
Committer: *ToApiSignature(commit.Committer),
CommitMessage: commit.CommitMessage,
@ -33,7 +33,7 @@ func ToApiCommit(commit *git.Commit) *api.Commit {
func HEADCommit(ctx *middleware.Context) {
ctx.JSON(200, &api.Sha1{
Sha1: ctx.Repo.Commit.Id.String(),
Sha1: ctx.Repo.Commit.ID.String(),
})
}
@ -95,7 +95,7 @@ func ToApiDiffFile(diffFile *models.DiffFile) *api.DiffFile {
Index: diffFile.Index,
Addition: diffFile.Addition,
Deletion: diffFile.Deletion,
Type: base.DiffTypeToStr(diffFile.Type),
Type: template.DiffTypeToStr(diffFile.Type),
IsCreated: diffFile.IsCreated,
IsDeleted: diffFile.IsDeleted,
IsBin: diffFile.IsBin,
@ -130,7 +130,7 @@ func ToApiDiffLine(diffLine *models.DiffLine) *api.DiffLine {
return &api.DiffLine{
LeftIdx: diffLine.LeftIdx,
RightIdx: diffLine.RightIdx,
Type: base.DiffLineTypeToStr(diffLine.Type),
Type: template.DiffLineTypeToStr(diffLine.Type),
Content: diffLine.Content,
}
}

18
routers/api/v1/repo_releases.go

@ -18,7 +18,7 @@ import (
func ToApiRelease(release *models.Release) *api.Release {
return &api.Release{
ID: release.Id,
ID: release.ID,
Publisher: *ToApiUser(release.Publisher),
TagName: release.TagName,
LowerTagName: release.LowerTagName,
@ -56,7 +56,7 @@ func ListReleases(ctx *middleware.Context) {
continue
}
if rel.TagName == rawTag {
rel.Publisher, err = models.GetUserByID(rel.PublisherId)
rel.Publisher, err = models.GetUserByID(rel.PublisherID)
if err != nil {
ctx.Handle(500, "GetUserById", err)
return
@ -99,10 +99,10 @@ func ListReleases(ctx *middleware.Context) {
tags[i] = &api.Release{
Title: rawTag,
TagName: rawTag,
Sha1: commit.Id.String(),
Sha1: commit.ID.String(),
}
tags[i].NumCommits, err = ctx.Repo.GitRepo.CommitsCount(commit.Id.String())
tags[i].NumCommits, err = ctx.Repo.GitRepo.CommitsCount(commit.ID.String())
if err != nil {
ctx.Handle(500, "CommitsCount", err)
return
@ -116,7 +116,7 @@ func ListReleases(ctx *middleware.Context) {
continue
}
rel.Publisher, err = models.GetUserByID(rel.PublisherId)
rel.Publisher, err = models.GetUserByID(rel.PublisherID)
if err != nil {
ctx.Handle(500, "GetUserById", err)
return
@ -157,7 +157,7 @@ func ReleaseByName(ctx *middleware.Context) {
return
}
publisher, err := models.GetUserByID(rel.PublisherId)
publisher, err := models.GetUserByID(rel.PublisherID)
if err != nil {
if models.IsErrUserNotExist(err) {
publisher = models.NewFakeUser()
@ -191,13 +191,13 @@ func CreateRelease(ctx *middleware.Context, form api.CreateReleaseOption) {
}
rel := &models.Release{
RepoId: ctx.Repo.Repository.ID,
RepoID: ctx.Repo.Repository.ID,
Publisher: ctx.User,
PublisherId: ctx.User.Id,
PublisherID: ctx.User.Id,
Title: form.Title,
TagName: form.TagName,
Target: form.Target,
Sha1: commit.Id.String(),
Sha1: commit.ID.String(),
NumCommits: commitsCount,
Note: form.Note,
IsDraft: form.IsDraft,

Loading…
Cancel
Save