Show the default branch in the default.

This commit is contained in:
takezoe
2013-06-06 16:40:54 +09:00
parent 497bc61107
commit ab4cde9301

View File

@@ -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 {
) )
} }
} }
}
}
} }