diff options
author | zeripath <art27@cantab.net> | 2021-06-20 23:39:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-21 00:39:12 +0200 |
commit | 196593e2e996aa4a59547629b870701f2b001d9b (patch) | |
tree | e9d5f63b07c54cdd74eecb53322b839abdfd979c /routers/web/repo/milestone.go | |
parent | 23358bc55de67be132e3858a5d40f25dbdd0a769 (diff) | |
download | gitea-196593e2e996aa4a59547629b870701f2b001d9b.tar.gz gitea-196593e2e996aa4a59547629b870701f2b001d9b.zip |
More efficiently parse shas for shaPostProcessor (#16101)
* More efficiently parse shas for shaPostProcessor
The shaPostProcessor currently repeatedly calls git rev-parse --verify on both backends
which is fine if there is only one thing that matches a sha - however if there are
multiple things then this becomes wildly inefficient.
This PR provides functions for both backends which are much faster to use.
Fix #16092
* Add ShaExistCache to RenderContext
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Diffstat (limited to 'routers/web/repo/milestone.go')
-rw-r--r-- | routers/web/repo/milestone.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/routers/web/repo/milestone.go b/routers/web/repo/milestone.go index bb6b310cbe..4cdca38dd0 100644 --- a/routers/web/repo/milestone.go +++ b/routers/web/repo/milestone.go @@ -88,6 +88,7 @@ func Milestones(ctx *context.Context) { m.RenderedContent, err = markdown.RenderString(&markup.RenderContext{ URLPrefix: ctx.Repo.RepoLink, Metas: ctx.Repo.Repository.ComposeMetas(), + GitRepo: ctx.Repo.GitRepo, }, m.Content) if err != nil { ctx.ServerError("RenderString", err) @@ -280,6 +281,7 @@ func MilestoneIssuesAndPulls(ctx *context.Context) { milestone.RenderedContent, err = markdown.RenderString(&markup.RenderContext{ URLPrefix: ctx.Repo.RepoLink, Metas: ctx.Repo.Repository.ComposeMetas(), + GitRepo: ctx.Repo.GitRepo, }, milestone.Content) if err != nil { ctx.ServerError("RenderString", err) |