summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/refdb_fs.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/refdb_fs.c b/src/refdb_fs.c
index 9db62810b..0b4bbb408 100644
--- a/src/refdb_fs.c
+++ b/src/refdb_fs.c
@@ -538,12 +538,16 @@ static int iter_load_loose_paths(refdb_fs_backend *backend, refdb_fs_iter *iter)
}
if ((error = git_buf_printf(&path, "%s/", backend->commonpath)) < 0 ||
- (error = git_buf_put(&path, ref_prefix, ref_prefix_len)) < 0 ||
- (error = git_iterator_for_filesystem(&fsit, path.ptr, &fsit_opts)) < 0) {
+ (error = git_buf_put(&path, ref_prefix, ref_prefix_len)) < 0) {
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;
+ }
+
error = git_buf_sets(&path, ref_prefix);
while (!error && !git_iterator_advance(&entry, fsit)) {