Add hashes filtering by the roots

There may be commits from different repositories but these commits can contain the same file. And git log will throw a bad object error
This commit is contained in:
Nikolay.Rykunov
2019-04-11 10:57:30 +03:00
parent 0f09d2c231
commit ece065b21d
@@ -20,7 +20,8 @@ internal class FilesHistoryProvider(private val project: Project, private val ro
private fun getCommitsData(commits: Collection<Int>): Map<Int, Commit> {
val hashes = mutableMapOf<String, Int>()
for (commit in commits) {
val hash = dataGetter.logStorage.getCommitId(commit)?.hash?.asString() ?: continue
val commitId = dataGetter.logStorage.getCommitId(commit) ?: continue
val hash = commitId.takeIf { commitId.root == root }?.hash?.asString() ?: continue
hashes[hash] = commit
}