@@ -7,7 +7,6 @@ package common
77import (
88 "fmt"
99 "io"
10- "net/http"
1110 "path"
1211 "path/filepath"
1312 "strings"
@@ -19,7 +18,6 @@ import (
1918 "code.gitea.io/gitea/modules/log"
2019 "code.gitea.io/gitea/modules/setting"
2120 "code.gitea.io/gitea/modules/typesniffer"
22- "code.gitea.io/gitea/services/archiver"
2321)
2422
2523// ServeBlob download a git.Blob
@@ -41,30 +39,6 @@ func ServeBlob(ctx *context.Context, blob *git.Blob) error {
4139 return ServeData (ctx , ctx .Repo .TreePath , blob .Size (), dataRc )
4240}
4341
44- // Download an archive of a repository
45- func Download (ctx * context.Context ) {
46- uri := ctx .Params ("*" )
47- aReq := archiver .DeriveRequestFrom (ctx , uri )
48-
49- if aReq == nil {
50- ctx .Error (http .StatusNotFound )
51- return
52- }
53-
54- downloadName := ctx .Repo .Repository .Name + "-" + aReq .GetArchiveName ()
55- complete := aReq .IsComplete ()
56- if ! complete {
57- aReq = archiver .ArchiveRepository (aReq )
58- complete = aReq .WaitForCompletion (ctx )
59- }
60-
61- if complete {
62- ctx .ServeFile (aReq .GetArchivePath (), downloadName )
63- } else {
64- ctx .Error (http .StatusNotFound )
65- }
66- }
67-
6842// ServeData download file from io.Reader
6943func ServeData (ctx * context.Context , name string , size int64 , reader io.Reader ) error {
7044 buf := make ([]byte , 1024 )
0 commit comments