refdb_fs: fix regression: failure when globbing for non-existant references#4665
refdb_fs: fix regression: failure when globbing for non-existant references#4665pks-t merged 2 commits intolibgit2:masterfrom
Conversation
|
@jacquesg could you check whether this fixes the issue you reported? |
|
@neithernut Confirmed, I no longer see the previous failures. Thanks! |
|
|
||
| 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.
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.
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.