odb: Fix odb foreach to also close on positive error code#4949
Merged
ethomson merged 1 commit intolibgit2:masterfrom Jan 20, 2019
zlikavac32:fix-odb-foreach-cb-positive-error-code
Merged
odb: Fix odb foreach to also close on positive error code#4949ethomson merged 1 commit intolibgit2:masterfrom zlikavac32:fix-odb-foreach-cb-positive-error-code
ethomson merged 1 commit intolibgit2:masterfrom
zlikavac32:fix-odb-foreach-cb-positive-error-code
Conversation
In include/git2/odb.h it states that callback can also return positive value which should break looping. Implementations of git_odb_foreach() and pack_backend__foreach() did not respect that.
Member
|
Hiya - thanks for the PR. This looks good to me, I'm fine with a little copypasta in our tests, I don't think there's a big need to use a You put |
Contributor
Author
|
@ethomson I'm ok, If you're ok :). WIP was more because this is my first PR here, so perhaps I'm missing something out. I'll remove it. Thanks |
Member
|
🎉 Thanks so much, this is a strict improvement. |
Member
|
Also:
Welcome to the libgit2 project. 😀 |
Contributor
Author
|
@ethomson No problem, thank you for your quick response. Now I can continue with your master :D
Thank you, I like this lib. No doubt I'll contribute again when I encounter something :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi,
This should be fix for #4946 .
I'm not familiar with internals, but all tests pass and I did add one new for this case. I don't like that copy/paste, so I was thinking about using struct (or 2 int array) so that only one callback exists in test. What do you think about that?
Also, should anything else be changed?
Thank you.