Skip to content
New issue

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

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

Already on GitHub? # to your account

Unable to stop iteration in tree.Walk() since #700 #837

Closed
fabpot opened this issue Sep 29, 2021 · 1 comment · Fixed by #838
Closed

Unable to stop iteration in tree.Walk() since #700 #837

fabpot opened this issue Sep 29, 2021 · 1 comment · Fixed by #838

Comments

@fabpot
Copy link

fabpot commented Sep 29, 2021

Since the refactoring done in #700, there is no way I can see that allows stopping the iteration from a callback passed to tree.Walk().

Before the PR, it was a matter of returning 1. Now, that does not work anymore.

Am I missing something? Is there any other way now to stop the iteration?

/cc @lhchavez

lhchavez added a commit to lhchavez/git2go that referenced this issue Sep 30, 2021
It is now possible to skip expanding an entry in `tree.Walk()` by
returning `TreeWalkSkip`, in addition to stopping altogether by
returning a non-nil error.

Fixes: libgit2#837
lhchavez added a commit that referenced this issue Sep 30, 2021
It is now possible to skip expanding an entry in `tree.Walk()` by
returning `TreeWalkSkip`, in addition to stopping altogether by
returning a non-nil error.

Fixes: #837
@fabpot
Copy link
Author

fabpot commented Oct 1, 2021

Thank you so much!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant