mirror of
https://github.com/gitbucket/gitbucket.git
synced 2026-01-04 22:59:58 +01:00
fix by review comment
This commit is contained in:
@@ -1140,7 +1140,7 @@ trait RepositoryViewerControllerBase extends ControllerBase {
|
||||
filename: String,
|
||||
repository: RepositoryService.RepositoryInfo,
|
||||
path: String
|
||||
): Unit = {
|
||||
) = {
|
||||
def archive(archiveFormat: String, archive: ArchiveOutputStream)(
|
||||
entryCreator: (String, Long, Int) => ArchiveEntry
|
||||
): Unit = {
|
||||
@@ -1194,6 +1194,7 @@ trait RepositoryViewerControllerBase extends ControllerBase {
|
||||
entry
|
||||
}
|
||||
}
|
||||
()
|
||||
case tarRe(compressor) =>
|
||||
response.setHeader("Content-Disposition", s"attachment; filename=${filename}")
|
||||
contentType = "application/octet-stream"
|
||||
@@ -1215,6 +1216,7 @@ trait RepositoryViewerControllerBase extends ControllerBase {
|
||||
}
|
||||
}
|
||||
}
|
||||
()
|
||||
case _ =>
|
||||
BadRequest()
|
||||
}
|
||||
|
||||
@@ -1253,7 +1253,7 @@ object JGitUtil {
|
||||
f(in)
|
||||
}
|
||||
} else {
|
||||
throw new RuntimeException
|
||||
throw new EmptyLfsAttributesException
|
||||
}
|
||||
} else {
|
||||
using(loader.openStream()) { in =>
|
||||
@@ -1276,4 +1276,7 @@ object JGitUtil {
|
||||
|
||||
JGitUtil.getLfsObjects(text)
|
||||
}
|
||||
|
||||
case class EmptyLfsAttributesException() extends Exception
|
||||
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<div class="head" style="height: 24px;">
|
||||
<div class="pull-right">
|
||||
<div class="btn-group">
|
||||
<a href="@{helpers.url(repository)}/archive/@{helpers.encodeRefName(branch)}@if(pathList.length > 0){/@pathList.mkString("/")}/@{helpers.encodeRefName(branch)}.zip" class="btn btn-sm btn-default"><i class="octicon octicon-cloud-download"></i> Download ZIP</a>
|
||||
<a href="@{helpers.url(repository)}/archive/@{helpers.encodeRefName(branch)}@if(pathList.length > 0){/@pathList.mkString("/")}/@{helpers.encodeRefName(branch)}.zip" class="btn btn-sm btn-default pc"><i class="octicon octicon-cloud-download"></i> Download ZIP</a>
|
||||
<a href="@helpers.url(repository)/find/@helpers.encodeRefName(branch)" class="btn btn-sm btn-default" data-hotkey="t"><i class="octicon octicon-search"></i></a>
|
||||
<a href="@helpers.url(repository)/commits/@helpers.encodeRefName((branch :: pathList).mkString("/"))" class="btn btn-sm btn-default"><i class="octicon octicon-history"></i> @if(commitCount > 10000){10000+} else {@commitCount} @helpers.plural(commitCount, "commit")</a>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user