mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[vcs-log] fix getting commit parents for commits without parents
GitOrigin-RevId: a893c8ef30ec20278e3b50a25dbc19c7a6283c47
This commit is contained in:
committed by
intellij-monorepo-bot
parent
0fa8562212
commit
fff71c0b41
+2
-3
@@ -255,7 +255,7 @@ internal class SqliteVcsLogStorageBackend(project: Project,
|
||||
}
|
||||
|
||||
override fun getParents(commitIds: Collection<Int>): Map<Int, List<Hash>> {
|
||||
val result = hashMapOf<Int, MutableList<Hash>>()
|
||||
val result = commitIds.associateWith { mutableListOf<Hash>() }
|
||||
val paramBinder = ObjectBinder(paramCount = 0)
|
||||
val inClause = commitIds.toInClause()
|
||||
val sql = "select p.rowid, c.hash from commit_hashes c inner join parent p on p.parent = c.rowid where p.commitId in $inClause"
|
||||
@@ -264,8 +264,7 @@ internal class SqliteVcsLogStorageBackend(project: Project,
|
||||
val rs = statement.executeQuery()
|
||||
while (rs.next()) {
|
||||
val commitId = rs.getInt(0)
|
||||
val hashes = result.getOrPut(commitId) { mutableListOf() }
|
||||
hashes.add(rs.getString(1)!!.let(HashImpl::build))
|
||||
result[commitId]?.add(rs.getString(1)!!.let(HashImpl::build))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user