From 41a613e1515fdfe7d8c4c11695f8501323e52e04 Mon Sep 17 00:00:00 2001 From: takezoe Date: Tue, 30 Jul 2013 02:45:14 +0900 Subject: [PATCH] Move private method. --- .../app/RepositoryViewerController.scala | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/main/scala/app/RepositoryViewerController.scala b/src/main/scala/app/RepositoryViewerController.scala index e1935a3c4..3a510c81f 100644 --- a/src/main/scala/app/RepositoryViewerController.scala +++ b/src/main/scala/app/RepositoryViewerController.scala @@ -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. */ @@ -192,7 +181,17 @@ trait RepositoryViewerControllerBase extends ControllerBase { BadRequest } }) - + + 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. *