summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2020-08-28 07:55:12 +0100
committerGitHub <noreply@github.com>2020-08-28 09:55:12 +0300
commiteb1bf2377be15deb593a3e2426558d92c1973107 (patch)
treeca01ae95beb2b5decc63c88334216130733f09f7 /routers
parentd3b5edacb655ced0135ca5f48544612ccc38890e (diff)
downloadgitea-eb1bf2377be15deb593a3e2426558d92c1973107.tar.gz
gitea-eb1bf2377be15deb593a3e2426558d92c1973107.zip
Set context for running CreateArchive in to that of the request (#12555)
Set the context for CreateArchive to that of the request to ensure that archives are only built for as long as a request is requesting them Fix #11551 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'routers')
-rw-r--r--routers/repo/repo.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/repo/repo.go b/routers/repo/repo.go
index 71df2d0cb7..5fc081a6f6 100644
--- a/routers/repo/repo.go
+++ b/routers/repo/repo.go
@@ -524,7 +524,7 @@ func Download(ctx *context.Context) {
archivePath = path.Join(archivePath, base.ShortSha(commit.ID.String())+ext)
if !com.IsFile(archivePath) {
- if err := commit.CreateArchive(archivePath, git.CreateArchiveOpts{
+ if err := commit.CreateArchive(ctx.Req.Context(), archivePath, git.CreateArchiveOpts{
Format: archiveType,
Prefix: setting.Repository.PrefixArchiveFiles,
}); err != nil {