Skip unreadable files for now.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
diff --git a/src/path.c b/src/path.c
index 55790ff..a056f69 100644
--- a/src/path.c
+++ b/src/path.c
@@ -1108,13 +1108,12 @@ int git_path_dirload_with_stat(
if ((error = git_buf_joinpath(&full, full.ptr, ps->path)) < 0 ||
(error = git_path_lstat(full.ptr, &ps->st)) < 0) {
- if (error == GIT_ENOTFOUND) {
+ if (error == GIT_ENOTFOUND || error == GIT_ENOACCESS) {
giterr_clear();
error = 0;
git_vector_remove(contents, i--);
continue;
}
-
break;
}
diff --git a/tests/status/worktree.c b/tests/status/worktree.c
index 5f4b7d6..1fdc112 100644
--- a/tests/status/worktree.c
+++ b/tests/status/worktree.c
@@ -955,16 +955,19 @@ void test_status_worktree__nopermissions(void)
counts.expected_entry_count = 1;
counts.expected_paths = expected_paths;
counts.expected_statuses = expected_statuses;
+ counts.debug = 1;
opts.show = GIT_STATUS_SHOW_WORKDIR_ONLY;
opts.flags = GIT_STATUS_OPT_DEFAULTS;
cl_git_pass(
git_status_foreach_ext(repo, &opts, cb_status__normal, &counts) );
+
+ // Restore permissions so we can cleanup :)
+ p_chmod("empty_standard_repo/no_permission", 0777);
+
cl_assert_equal_i(counts.expected_entry_count, counts.entry_count);
cl_assert_equal_i(0, counts.wrong_status_flags_count);
cl_assert_equal_i(0, counts.wrong_sorted_path);
- // Restore permissions so we can cleanup :)
- p_chmod("empty_standard_repo/no_permission", 0777);
}