(refs #721)NullPointerException on getFileList if branch has multi-origin and get sub-folder file list

This commit is contained in:
nazoking
2015-04-22 13:45:31 +09:00
parent 43b7f83082
commit ebc5219ce6
2 changed files with 11 additions and 4 deletions

View File

@@ -90,4 +90,14 @@ class JGitUtilSpec extends Specification {
list("master", "dir/subdir") mustEqual List(("File3.md", "commit7", false), ("File4.md", "commit4", false))
}
}
}
"getFileList subfolder multi-origin (issue #721)" should {
withTestRepository { git =>
def list(branch: String, path: String) =
JGitUtil.getFileList(git, branch, path).map(finfo => (finfo.name, finfo.message, finfo.isDirectory))
createFile(git, "master", "README.md", "body1", message = "commit1")
createFile(git, "branch", "test/text2.txt", "body2", message = "commit2")
mergeAndCommit(git, "master", "branch", message = "merge3")
list("master", "test") mustEqual List(("text2.txt", "commit2", false))
}
}
}