This commit is contained in:
Lunny Xiao 2024-11-20 19:41:26 -08:00
parent a7f02a037d
commit 2362ed1fed
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
1 changed files with 4 additions and 0 deletions

View File

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