summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2020-01-22 23:46:46 +0000
committerGitHub <noreply@github.com>2020-01-22 23:46:46 +0000
commitc8d7ae1ee33e31ed15632a26c74ba9a3ea115043 (patch)
treef26103ff819952d2875a48ce0b1fe99417ad2bbd /routers
parent608cd58db670b061ca898930401458b30264a6c9 (diff)
downloadgitea-c8d7ae1ee33e31ed15632a26c74ba9a3ea115043.tar.gz
gitea-c8d7ae1ee33e31ed15632a26c74ba9a3ea115043.zip
Make archive prefixing configurable with a global setting (#9943)
* Allow archive prefix setting * Update copyright * Update copyright
Diffstat (limited to 'routers')
-rw-r--r--routers/repo/repo.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/routers/repo/repo.go b/routers/repo/repo.go
index 0bd9f1d56b..6b6b22f3a1 100644
--- a/routers/repo/repo.go
+++ b/routers/repo/repo.go
@@ -1,4 +1,5 @@
// Copyright 2014 The Gogs Authors. All rights reserved.
+// Copyright 2020 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
@@ -507,7 +508,10 @@ func Download(ctx *context.Context) {
archivePath = path.Join(archivePath, base.ShortSha(commit.ID.String())+ext)
if !com.IsFile(archivePath) {
- if err := commit.CreateArchive(archivePath, archiveType); err != nil {
+ if err := commit.CreateArchive(archivePath, git.CreateArchiveOpts{
+ Format: archiveType,
+ Prefix: setting.Repository.PrefixArchiveFiles,
+ }); err != nil {
ctx.ServerError("Download -> CreateArchive "+archivePath, err)
return
}