diff options
| author | Vicent Martà <vicent@github.com> | 2013-09-24 12:01:24 -0700 |
|---|---|---|
| committer | Vicent Martà <vicent@github.com> | 2013-09-24 12:01:24 -0700 |
| commit | 95bff9d443b57424cb20928cd06177a08e38d638 (patch) | |
| tree | 48ab07b34700939169e9b1fe21279d9ce232c554 | |
| parent | 4a1b40159b4b0b2a954d40e4489331e3f22c8994 (diff) | |
| parent | 5c3b8ef48bcbf0843cdc7272fec7a32819998f58 (diff) | |
| download | libgit2-95bff9d443b57424cb20928cd06177a08e38d638.tar.gz | |
Merge pull request #1869 from ethomson/fs_iterator_race_2
Ignore files that disappear while iterating
| -rw-r--r-- | src/path.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/path.c b/src/path.c index 42b3d6f3e..9d8e90361 100644 --- a/src/path.c +++ b/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) |
