Open lubosmj opened 3 years ago
It probably should call g_variant_is_of_type
and return a friendlier error instead of blindly using it, but the problem is that you're passing some GVariant, but not the right kind. You basically have the commit checksum, but you need to read the actual commit object.
I'd probably do it more like this:
_, checksum = repo.resolve_rev('foo', False)
_, commit, _ = repo.load_commit(checksum)
parent = OSTree.commit_get_parent(commit)
The key being that load_commit
will read and return the commit object GVariant.
Hello!
I have run into an error when I was trying to get a parent commit. I followed the steps provided at https://ostree.readthedocs.io/en/stable/manual/introduction/ to create an OSTree repository. Calling
OSTree.commit_get_parent(commit)
on the latestcommit
eventually triggered an error. I was using python bindings (https://lazka.github.io/pgi-docs/#OSTree-1.0/functions.html#OSTree.commit_get_parent).Steps to reproduce the behaviour:
The same behaviour occurs for:
Is this a known issue?