diff --git a/src/main/scala/gitbucket/core/controller/RepositoryViewerController.scala b/src/main/scala/gitbucket/core/controller/RepositoryViewerController.scala index a593a0f..ed24a88 100644 --- a/src/main/scala/gitbucket/core/controller/RepositoryViewerController.scala +++ b/src/main/scala/gitbucket/core/controller/RepositoryViewerController.scala @@ -1140,7 +1140,7 @@ filename: String, repository: RepositoryService.RepositoryInfo, path: String - ): Unit = { + ) = { def archive(archiveFormat: String, archive: ArchiveOutputStream)( entryCreator: (String, Long, Int) => ArchiveEntry ): Unit = { @@ -1194,6 +1194,7 @@ entry } } + () case tarRe(compressor) => response.setHeader("Content-Disposition", s"attachment; filename=${filename}") contentType = "application/octet-stream" @@ -1215,6 +1216,7 @@ } } } + () case _ => BadRequest() } diff --git a/src/main/scala/gitbucket/core/util/JGitUtil.scala b/src/main/scala/gitbucket/core/util/JGitUtil.scala index 811302d..01cd500 100644 --- a/src/main/scala/gitbucket/core/util/JGitUtil.scala +++ b/src/main/scala/gitbucket/core/util/JGitUtil.scala @@ -1253,7 +1253,7 @@ f(in) } } else { - throw new RuntimeException + throw new EmptyLfsAttributesException } } else { using(loader.openStream()) { in => @@ -1276,4 +1276,7 @@ JGitUtil.getLfsObjects(text) } + + case class EmptyLfsAttributesException() extends Exception + } diff --git a/src/main/twirl/gitbucket/core/repo/files.scala.html b/src/main/twirl/gitbucket/core/repo/files.scala.html index 0c8d5f4..8fe761c 100644 --- a/src/main/twirl/gitbucket/core/repo/files.scala.html +++ b/src/main/twirl/gitbucket/core/repo/files.scala.html @@ -33,7 +33,7 @@