diff options
Diffstat (limited to 'routers/web/repo/commit.go')
-rw-r--r-- | routers/web/repo/commit.go | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/routers/web/repo/commit.go b/routers/web/repo/commit.go index 1636a6c293..164dc181f0 100644 --- a/routers/web/repo/commit.go +++ b/routers/web/repo/commit.go @@ -11,9 +11,10 @@ import ( "net/http" "strings" - "code.gitea.io/gitea/models" asymkey_model "code.gitea.io/gitea/models/asymkey" "code.gitea.io/gitea/models/db" + git_model "code.gitea.io/gitea/models/git" + repo_model "code.gitea.io/gitea/models/repo" user_model "code.gitea.io/gitea/models/user" "code.gitea.io/gitea/modules/base" "code.gitea.io/gitea/modules/charset" @@ -75,7 +76,7 @@ func Commits(ctx *context.Context) { ctx.ServerError("CommitsByRange", err) return } - ctx.Data["Commits"] = models.ConvertFromGitCommit(commits, ctx.Repo.Repository) + ctx.Data["Commits"] = git_model.ConvertFromGitCommit(commits, ctx.Repo.Repository) ctx.Data["Username"] = ctx.Repo.Owner.Name ctx.Data["Reponame"] = ctx.Repo.Repository.Name @@ -194,7 +195,7 @@ func SearchCommits(ctx *context.Context) { return } ctx.Data["CommitCount"] = len(commits) - ctx.Data["Commits"] = models.ConvertFromGitCommit(commits, ctx.Repo.Repository) + ctx.Data["Commits"] = git_model.ConvertFromGitCommit(commits, ctx.Repo.Repository) ctx.Data["Keyword"] = query if all { @@ -235,7 +236,7 @@ func FileHistory(ctx *context.Context) { ctx.ServerError("CommitsByFileAndRange", err) return } - ctx.Data["Commits"] = models.ConvertFromGitCommit(commits, ctx.Repo.Repository) + ctx.Data["Commits"] = git_model.ConvertFromGitCommit(commits, ctx.Repo.Repository) ctx.Data["Username"] = ctx.Repo.Owner.Name ctx.Data["Reponame"] = ctx.Repo.Repository.Name @@ -335,12 +336,12 @@ func Diff(ctx *context.Context) { ctx.Data["Commit"] = commit ctx.Data["Diff"] = diff - statuses, _, err := models.GetLatestCommitStatus(ctx, ctx.Repo.Repository.ID, commitID, db.ListOptions{}) + statuses, _, err := git_model.GetLatestCommitStatus(ctx, ctx.Repo.Repository.ID, commitID, db.ListOptions{}) if err != nil { log.Error("GetLatestCommitStatus: %v", err) } - ctx.Data["CommitStatus"] = models.CalcCommitStatus(statuses) + ctx.Data["CommitStatus"] = git_model.CalcCommitStatus(statuses) ctx.Data["CommitStatuses"] = statuses verification := asymkey_model.ParseCommitWithSignature(commit) @@ -350,7 +351,7 @@ func Diff(ctx *context.Context) { ctx.Data["DiffNotAvailable"] = diff.NumFiles == 0 if err := asymkey_model.CalculateTrustStatus(verification, ctx.Repo.Repository.GetTrustModel(), func(user *user_model.User) (bool, error) { - return models.IsOwnerMemberCollaborator(ctx.Repo.Repository, user.ID) + return repo_model.IsOwnerMemberCollaborator(ctx.Repo.Repository, user.ID) }, nil); err != nil { ctx.ServerError("CalculateTrustStatus", err) return |