diff options
Diffstat (limited to 'routers')
-rw-r--r-- | routers/repo/commit.go | 22 | ||||
-rw-r--r-- | routers/repo/view.go | 7 |
2 files changed, 17 insertions, 12 deletions
diff --git a/routers/repo/commit.go b/routers/repo/commit.go index 82be6881fa..619c6c815c 100644 --- a/routers/repo/commit.go +++ b/routers/repo/commit.go @@ -33,6 +33,16 @@ func RefCommits(ctx *middleware.Context) { } } +func RenderIssueLinks(oldCommits *list.List, repoLink string) *list.List { + newCommits := list.New() + for e := oldCommits.Front(); e != nil; e = e.Next() { + c := e.Value.(*git.Commit) + c.CommitMessage = string(base.RenderIssueIndexPattern([]byte(c.CommitMessage), repoLink)) + newCommits.PushBack(c) + } + return newCommits +} + func Commits(ctx *middleware.Context) { ctx.Data["IsRepoToolbarCommits"] = true @@ -86,16 +96,6 @@ func Commits(ctx *middleware.Context) { ctx.HTML(200, COMMITS) } -func RenderIssueLinks(oldCommits *list.List, repoLink string) *list.List { - newCommits := list.New() - for e := oldCommits.Front(); e != nil; e = e.Next() { - c := e.Value.(*git.Commit) - c.CommitMessage = string(base.RenderissueIndexPattern([]byte(c.CommitMessage), repoLink)) - newCommits.PushBack(c) - } - return newCommits -} - func SearchCommits(ctx *middleware.Context) { ctx.Data["IsSearchPage"] = true ctx.Data["IsRepoToolbarCommits"] = true @@ -206,7 +206,7 @@ func Diff(ctx *middleware.Context) { commitId := ctx.Repo.CommitId commit := ctx.Repo.Commit - commit.CommitMessage = string(base.RenderissueIndexPattern([]byte(commit.CommitMessage), ctx.Repo.RepoLink)) + commit.CommitMessage = string(base.RenderIssueIndexPattern([]byte(commit.CommitMessage), ctx.Repo.RepoLink)) diff, err := models.GetDiffCommit(models.RepoPath(userName, repoName), commitId, setting.MaxGitDiffLines) if err != nil { diff --git a/routers/repo/view.go b/routers/repo/view.go index 073eb5d74e..2fb411589a 100644 --- a/routers/repo/view.go +++ b/routers/repo/view.go @@ -152,6 +152,11 @@ func Home(ctx *middleware.Context) { } } + // Render issue index links. + for _, f := range files { + c := f[1].(*git.Commit) + c.CommitMessage = string(base.RenderIssueIndexPattern([]byte(c.CommitMessage), ctx.Repo.RepoLink)) + } ctx.Data["Files"] = files var readmeFile *git.Blob @@ -199,7 +204,7 @@ func Home(ctx *middleware.Context) { } lastCommit := ctx.Repo.Commit - lastCommit.CommitMessage = string(base.RenderissueIndexPattern([]byte(lastCommit.CommitMessage), ctx.Repo.RepoLink)) + lastCommit.CommitMessage = string(base.RenderIssueIndexPattern([]byte(lastCommit.CommitMessage), ctx.Repo.RepoLink)) if len(treePath) > 0 { c, err := ctx.Repo.Commit.GetCommitOfRelPath(treePath) if err != nil { |