Closed
Description
I can query a repo for its refs:
val toDelete = repo.listRefs().asList().filter { it.ref == "refs/heads/$version" || it.ref == "refs/heads/$otherVersion" }
but when I try to delete a ref:
toDelete.forEach {
it.delete()
}
I get a NullPointerException
because root
is null
within the GHRef
for some reason.
What is the proper way of deleting a ref?
A workaround I found is to do this:
toDelete.forEach {
repo.getRef(it.ref.replace("refs/", "")).delete()
}
This highlights another discrepancy: when I call getRef
I have to remove the refs/
part to properly fetch the ref.
Metadata
Metadata
Assignees
Labels
No labels