mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-03 20:15:59 +01:00
Show the default branch in the default.
This commit is contained in:
@@ -230,8 +230,11 @@ trait RepositoryViewerControllerBase extends ControllerBase {
|
||||
* @return HTML of the file list
|
||||
*/
|
||||
private def fileList(owner: String, repository: String, revstr: String = "", path: String = ".") = {
|
||||
getRepository(owner, repository, servletContext) match {
|
||||
case None => NotFound()
|
||||
case Some(repositoryInfo) => {
|
||||
val revision = if(revstr.isEmpty){
|
||||
Git.open(getRepositoryDir(owner, repository)).getRepository.getBranch
|
||||
repositoryInfo.repository.defaultBranch
|
||||
} else {
|
||||
revstr
|
||||
}
|
||||
@@ -251,7 +254,7 @@ trait RepositoryViewerControllerBase extends ControllerBase {
|
||||
// current branch
|
||||
revision,
|
||||
// repository
|
||||
getRepository(owner, repository, servletContext).get,
|
||||
repositoryInfo,
|
||||
// current path
|
||||
if(path == ".") Nil else path.split("/").toList,
|
||||
// latest commit
|
||||
@@ -263,5 +266,7 @@ trait RepositoryViewerControllerBase extends ControllerBase {
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user