Move private method.

This commit is contained in:
takezoe
2013-07-30 02:45:14 +09:00
parent 1f2b6a0acc
commit 41a613e151

View File

@@ -68,17 +68,6 @@ trait RepositoryViewerControllerBase extends ControllerBase {
}
})
private def splitPath(repository: service.RepositoryService.RepositoryInfo, path: String): (String, String) = {
val id = repository.branchList.collectFirst {
case branch if(path == branch || path.startsWith(branch + "/")) => branch
} orElse repository.tags.collectFirst {
case tag if(path == tag.name || path.startsWith(tag.name + "/")) => tag.name
} orElse Some(path) get
(id, path.substring(id.length).replaceFirst("^/", ""))
}
/**
* Displays the file content of the specified branch or commit.
*/
@@ -193,6 +182,16 @@ trait RepositoryViewerControllerBase extends ControllerBase {
}
})
private def splitPath(repository: service.RepositoryService.RepositoryInfo, path: String): (String, String) = {
val id = repository.branchList.collectFirst {
case branch if(path == branch || path.startsWith(branch + "/")) => branch
} orElse repository.tags.collectFirst {
case tag if(path == tag.name || path.startsWith(tag.name + "/")) => tag.name
} orElse Some(path) get
(id, path.substring(id.length).replaceFirst("^/", ""))
}
/**
* Provides HTML of the file list.
*