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

Propagate errors on Tree::walk #1098

Merged
merged 2 commits into from
Jan 4, 2025
Merged

Conversation

edrevo
Copy link
Contributor

@edrevo edrevo commented Nov 19, 2024

Tree::walk was ignoring errors coming from libgit2. This PR fixes that and adds a unit test.

@edrevo edrevo force-pushed the edrevo/fix-tree-walk branch from f0ea72d to 1cd7a94 Compare November 19, 2024 14:03
@edrevo edrevo force-pushed the edrevo/fix-tree-walk branch from 1cd7a94 to 41d8e06 Compare November 19, 2024 14:04
@edrevo
Copy link
Contributor Author

edrevo commented Nov 25, 2024

@weihanglo, would you be able to take a look at this PR?

* I'm pretty sure the fn pointer doesn't need to have `*const`.
* No need to move `Convert` around, can just use `as` for an enum
  (can maybe just remove this impl?).
* Verify the actual error in the test.
@ehuss ehuss force-pushed the edrevo/fix-tree-walk branch from 3ce2f87 to e0d7dae Compare January 4, 2025 22:30
Copy link
Contributor

@ehuss ehuss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I pushed an update to try to minimize some of the changes here.

I'm not really clear on why d70b645 made all function pointers Option. In this particular case, the pointer cannot be NULL, so it seems like it should be fine. 🤷

@ehuss ehuss added this pull request to the merge queue Jan 4, 2025
Merged via the queue into rust-lang:master with commit 3b8dc04 Jan 4, 2025
7 checks passed
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.

2 participants