diff options
Diffstat (limited to 'services')
-rw-r--r-- | services/archiver/archiver.go | 25 | ||||
-rw-r--r-- | services/auth/placeholder.go | 1 |
2 files changed, 19 insertions, 7 deletions
diff --git a/services/archiver/archiver.go b/services/archiver/archiver.go index 00c0281306..7ae0a94d7e 100644 --- a/services/archiver/archiver.go +++ b/services/archiver/archiver.go @@ -54,6 +54,9 @@ func NewRequest(repoID int64, repo *git.Repository, uri string) (*ArchiveRequest case strings.HasSuffix(uri, ".tar.gz"): ext = ".tar.gz" r.Type = git.TARGZ + case strings.HasSuffix(uri, ".bundle"): + ext = ".bundle" + r.Type = git.BUNDLE default: return nil, fmt.Errorf("Unknown format: %s", uri) } @@ -165,13 +168,21 @@ func doArchive(r *ArchiveRequest) (*models.RepoArchiver, error) { } }() - err = gitRepo.CreateArchive( - graceful.GetManager().ShutdownContext(), - archiver.Type, - w, - setting.Repository.PrefixArchiveFiles, - archiver.CommitID, - ) + if archiver.Type == git.BUNDLE { + err = gitRepo.CreateBundle( + graceful.GetManager().ShutdownContext(), + archiver.CommitID, + w, + ) + } else { + err = gitRepo.CreateArchive( + graceful.GetManager().ShutdownContext(), + archiver.Type, + w, + setting.Repository.PrefixArchiveFiles, + archiver.CommitID, + ) + } _ = w.CloseWithError(err) done <- err }(done, w, archiver, gitRepo) diff --git a/services/auth/placeholder.go b/services/auth/placeholder.go index 50e3061885..d9a0ceae7c 100644 --- a/services/auth/placeholder.go +++ b/services/auth/placeholder.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. +//go:build !windows // +build !windows package auth |