Performance Improve for getFileList

This commit is contained in:
nazoking
2015-03-29 01:21:10 +09:00
parent b39e863591
commit 27864a3a3c
2 changed files with 105 additions and 64 deletions

View File

@@ -7,11 +7,8 @@ class JGitUtilSpec extends Specification {
"getFileList(git: Git, revision: String, path)" should {
withTestRepository { git =>
def list(branch: String, path: String) = try {
def list(branch: String, path: String) =
JGitUtil.getFileList(git, branch, path).map(finfo => (finfo.name, finfo.message, finfo.isDirectory))
} catch {
case e: NullPointerException => Nil
}
list("master", ".") mustEqual Nil
list("master", "dir/subdir") mustEqual Nil
list("branch", ".") mustEqual Nil