mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-06 21:45:50 +01:00
Move private method.
This commit is contained in:
@@ -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.
|
* 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.
|
* Provides HTML of the file list.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user