Fixed crash when creating the graph if the repo contains tags that point to blobs

This commit is contained in:
Abdelilah El Aissaoui 2022-04-11 04:27:25 +02:00
parent 14eb5f8c9c
commit b68135d3a4

View File

@ -117,8 +117,12 @@ class GraphWalk(private var repository: Repository?) : RevWalk(repository) {
is RevCommit -> markStart(refTarget)
// RevTag case handles commits without branches but only tags.
is RevTag -> {
if(refTarget.`object` is RevCommit) {
val commit = lookupCommit(refTarget.`object`)
markStart(commit)
} else {
println("Tag ${refTarget.tagName} is pointing to ${refTarget.`object`::class.simpleName}")
}
}
}
} catch (e: MissingObjectException) {