|
|
@ -54,6 +54,9 @@ func NewRequest(repoID int64, repo *git.Repository, uri string) (*ArchiveRequest |
|
|
|
case strings.HasSuffix(uri, ".tar.gz"): |
|
|
|
case strings.HasSuffix(uri, ".tar.gz"): |
|
|
|
ext = ".tar.gz" |
|
|
|
ext = ".tar.gz" |
|
|
|
r.Type = git.TARGZ |
|
|
|
r.Type = git.TARGZ |
|
|
|
|
|
|
|
case strings.HasSuffix(uri, ".bundle"): |
|
|
|
|
|
|
|
ext = ".bundle" |
|
|
|
|
|
|
|
r.Type = git.BUNDLE |
|
|
|
default: |
|
|
|
default: |
|
|
|
return nil, fmt.Errorf("Unknown format: %s", uri) |
|
|
|
return nil, fmt.Errorf("Unknown format: %s", uri) |
|
|
|
} |
|
|
|
} |
|
|
@ -165,6 +168,13 @@ func doArchive(r *ArchiveRequest) (*models.RepoArchiver, error) { |
|
|
|
} |
|
|
|
} |
|
|
|
}() |
|
|
|
}() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if archiver.Type == git.BUNDLE { |
|
|
|
|
|
|
|
err = gitRepo.CreateBundle( |
|
|
|
|
|
|
|
graceful.GetManager().ShutdownContext(), |
|
|
|
|
|
|
|
archiver.CommitID, |
|
|
|
|
|
|
|
w, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} else { |
|
|
|
err = gitRepo.CreateArchive( |
|
|
|
err = gitRepo.CreateArchive( |
|
|
|
graceful.GetManager().ShutdownContext(), |
|
|
|
graceful.GetManager().ShutdownContext(), |
|
|
|
archiver.Type, |
|
|
|
archiver.Type, |
|
|
@ -172,6 +182,7 @@ func doArchive(r *ArchiveRequest) (*models.RepoArchiver, error) { |
|
|
|
setting.Repository.PrefixArchiveFiles, |
|
|
|
setting.Repository.PrefixArchiveFiles, |
|
|
|
archiver.CommitID, |
|
|
|
archiver.CommitID, |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
_ = w.CloseWithError(err) |
|
|
|
_ = w.CloseWithError(err) |
|
|
|
done <- err |
|
|
|
done <- err |
|
|
|
}(done, w, archiver, gitRepo) |
|
|
|
}(done, w, archiver, gitRepo) |
|
|
|