Skip to content

repo.descendant_of() always returns True on invalid SHA's #822

Closed
@cjerdonek

Description

@cjerdonek

I'm getting that if you pass a 40-character string SHA to repo.descendant_of() that doesn't correspond to a commit (for either argument), then the function always returns True. I haven't verified, but it looks like it could be because of this line:

return PyBool_FromLong(git_graph_descendant_of(self->repo, &oid1, &oid2));

The PyBool_FromLong() converts an error code to True. Instead, an error code should result in an exception IMO.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions