-
Notifications
You must be signed in to change notification settings - Fork 2.5k
refdb_fs: fix regression: failure when globbing for non-existant references #4665
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
Conversation
@jacquesg could you check whether this fixes the issue you reported? |
@neithernut Confirmed, I no longer see the previous failures. Thanks! |
git_buf_free(&path); | ||
return error; | ||
} | ||
|
||
if ((error = git_iterator_for_filesystem(&fsit, path.ptr, &fsit_opts)) < 0) { | ||
git_buf_free(&path); | ||
return (iter->glob && error == GIT_ENOTFOUND)? 0 : error; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to check whether we have a globbing iterator or not? In the case where the iterator is not using globs, we're always using "refs/" as our entrypoint, and absence of that would certainly be unexpected. What is our current failure mode in that case? Do we error out or do we just report 0 references?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error gets propagated to the caller. I felt that it would be wrong to hide the error in this case. And the additional check hints at why GIT_ENOTFOUND
can be ignored.
The fixup makes sense to me, thanks. Just waiting for some clarification on my comment and then I'd be good to merge |
This commit fixes a regression introduced by 20a2b02 The commit introduced an optimization for finding references using a glob: rather than iterating over all references and matching each one against the glob, we would iterate only over references within the directory common to all possible references which may match against the glob. However, contrary to the `ref/` directory, which was the previous entry point for the iteration, this directory may not exist. In this case, the optimization causes an error (`ENOENT`) rather than the iterator simply yielding no references. This patch fixes the regression by checkign for this specific case.
5d07f07
to
d7eca4c
Compare
Squashed in order to save a round-trip. |
Waiting a few days whether there's feedback by others |
Thanks again for your fix! |
Fixes #4664.