Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repository.applies: new option raise_error #1166

Merged
merged 1 commit into from
Oct 10, 2022

Conversation

jorio
Copy link
Contributor

@jorio jorio commented Oct 9, 2022

Repository.applies() checks if a patch can be applied to HEAD without writing it. Currently, it doesn't provide any info beyond a boolean return value.

This PR adds an optional argument raise_error to Repository.applies. If raise_error=True, an exception will be raised if the patch doesn't apply. This lets the user get more detailed info from libgit2 about the failure to apply the patch.

By default, raise_error is False, so any existing code that depends on Repository.applies will keep working without changes.

@jdavid jdavid merged commit e6f56de into libgit2:master Oct 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants