mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-29 00:30:27 +00:00
Merge pull request #1869 from ethomson/fs_iterator_race_2
Ignore files that disappear while iterating
This commit is contained in:
commit
95bff9d443
10
src/path.c
10
src/path.c
@ -902,8 +902,16 @@ int git_path_dirload_with_stat(
|
||||
git_buf_truncate(&full, prefix_len);
|
||||
|
||||
if ((error = git_buf_joinpath(&full, full.ptr, ps->path)) < 0 ||
|
||||
(error = git_path_lstat(full.ptr, &ps->st)) < 0)
|
||||
(error = git_path_lstat(full.ptr, &ps->st)) < 0) {
|
||||
if (error == GIT_ENOTFOUND) {
|
||||
giterr_clear();
|
||||
error = 0;
|
||||
git_vector_remove(contents, i--);
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (S_ISDIR(ps->st.st_mode)) {
|
||||
if ((error = git_buf_joinpath(&full, full.ptr, ".git")) < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user