mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-06 05:25:50 +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
|
* @return HTML of the file list
|
||||||
*/
|
*/
|
||||||
private def fileList(owner: String, repository: String, revstr: String = "", path: String = ".") = {
|
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){
|
val revision = if(revstr.isEmpty){
|
||||||
Git.open(getRepositoryDir(owner, repository)).getRepository.getBranch
|
repositoryInfo.repository.defaultBranch
|
||||||
} else {
|
} else {
|
||||||
revstr
|
revstr
|
||||||
}
|
}
|
||||||
@@ -251,7 +254,7 @@ trait RepositoryViewerControllerBase extends ControllerBase {
|
|||||||
// current branch
|
// current branch
|
||||||
revision,
|
revision,
|
||||||
// repository
|
// repository
|
||||||
getRepository(owner, repository, servletContext).get,
|
repositoryInfo,
|
||||||
// current path
|
// current path
|
||||||
if(path == ".") Nil else path.split("/").toList,
|
if(path == ".") Nil else path.split("/").toList,
|
||||||
// latest commit
|
// latest commit
|
||||||
@@ -263,5 +266,7 @@ trait RepositoryViewerControllerBase extends ControllerBase {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user