1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Make archive prefixing configurable with a global setting (#9943)

* Allow archive prefix setting

* Update copyright

* Update copyright
This commit is contained in:
zeripath
2020-01-22 23:46:46 +00:00
committed by GitHub
parent 608cd58db6
commit c8d7ae1ee3
5 changed files with 45 additions and 10 deletions

View File

@@ -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
}