From 2362ed1fed611233c06d0a69779a478092ef4c4b Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Wed, 20 Nov 2024 19:41:26 -0800 Subject: [PATCH] Fix test --- services/repository/archiver/archiver.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/repository/archiver/archiver.go b/services/repository/archiver/archiver.go index e163deb0f6..e1addbed33 100644 --- a/services/repository/archiver/archiver.go +++ b/services/repository/archiver/archiver.go @@ -88,6 +88,10 @@ func ParseFileName(uri string) (ext string, tp git.ArchiveType, err error) { // resulting ArchiveRequest is suitable for being passed to Await() // if it's determined that the request still needs to be satisfied. func NewRequest(repoID int64, repo *git.Repository, refName string, fileType git.ArchiveType) (*ArchiveRequest, error) { + if fileType < git.ZIP || fileType > git.BUNDLE { + return nil, ErrUnknownArchiveFormat{RequestFormat: fileType.String()} + } + r := &ArchiveRequest{ RepoID: repoID, refName: refName,