diff --git a/build.sbt b/build.sbt index 23203d9..1911a7c 100644 --- a/build.sbt +++ b/build.sbt @@ -39,7 +39,7 @@ "commons-io" % "commons-io" % "2.15.0", "io.github.gitbucket" % "solidbase" % "1.0.5", "io.github.gitbucket" % "markedj" % "1.0.18", - "org.apache.commons" % "commons-compress" % "1.24.0", + "org.apache.commons" % "commons-compress" % "1.25.0", "org.apache.commons" % "commons-email" % "1.5", "commons-net" % "commons-net" % "3.10.0", "org.apache.httpcomponents" % "httpclient" % "4.5.14", diff --git a/src/main/scala/gitbucket/core/controller/RepositoryViewerController.scala b/src/main/scala/gitbucket/core/controller/RepositoryViewerController.scala index ba09e06..1c95255 100644 --- a/src/main/scala/gitbucket/core/controller/RepositoryViewerController.scala +++ b/src/main/scala/gitbucket/core/controller/RepositoryViewerController.scala @@ -1238,8 +1238,8 @@ repository: RepositoryService.RepositoryInfo, path: String ) = { - def archive(revision: String, archiveFormat: String, archive: ArchiveOutputStream)( - entryCreator: (String, Long, java.util.Date, Int) => ArchiveEntry + def archive[A <: ArchiveEntry](revision: String, archiveFormat: String, archive: ArchiveOutputStream[A])( + entryCreator: (String, Long, java.util.Date, Int) => A ): Unit = { Using.resource(Git.open(getRepositoryDir(repository.owner, repository.name))) { git => val oid = git.getRepository.resolve(revision) @@ -1281,7 +1281,7 @@ ) } - val entry: ArchiveEntry = entryCreator(entryPath, size, date, mode) + val entry: A = entryCreator(entryPath, size, date, mode) archive.putArchiveEntry(entry) Using.resource(new FileInputStream(tempFile)) { in => IOUtils.copy(in, archive)