From 11208f33818ae3fe2f32581285c358b5cfcf5992 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sat, 16 Nov 2019 08:47:57 +0800 Subject: [PATCH] Move git graph from models to modules/graph (#9027) --- {models => modules/gitgraph}/graph.go | 2 +- {models => modules/gitgraph}/graph_test.go | 2 +- routers/repo/commit.go | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) rename {models => modules/gitgraph}/graph.go (99%) rename {models => modules/gitgraph}/graph_test.go (99%) diff --git a/models/graph.go b/modules/gitgraph/graph.go similarity index 99% rename from models/graph.go rename to modules/gitgraph/graph.go index 0efb51b3f..0dd68ad5c 100644 --- a/models/graph.go +++ b/modules/gitgraph/graph.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. -package models +package gitgraph import ( "fmt" diff --git a/models/graph_test.go b/modules/gitgraph/graph_test.go similarity index 99% rename from models/graph_test.go rename to modules/gitgraph/graph_test.go index 78bfcb27e..a2c7f447b 100644 --- a/models/graph_test.go +++ b/modules/gitgraph/graph_test.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. -package models +package gitgraph import ( "fmt" diff --git a/routers/repo/commit.go b/routers/repo/commit.go index 2a123a2eb..084c49517 100644 --- a/routers/repo/commit.go +++ b/routers/repo/commit.go @@ -14,6 +14,7 @@ import ( "code.gitea.io/gitea/modules/charset" "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/git" + "code.gitea.io/gitea/modules/gitgraph" "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/services/gitdiff" @@ -99,7 +100,7 @@ func Graph(ctx *context.Context) { page := ctx.QueryInt("page") - graph, err := models.GetCommitGraph(ctx.Repo.GitRepo, page) + graph, err := gitgraph.GetCommitGraph(ctx.Repo.GitRepo, page) if err != nil { ctx.ServerError("GetCommitGraph", err) return