diff options
Diffstat (limited to 'src/path.c')
-rw-r--r-- | src/path.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/path.c b/src/path.c index c3487daf2..bc89a9be9 100644 --- a/src/path.c +++ b/src/path.c @@ -560,10 +560,10 @@ int git_path_set_error(int errno_value, const char *path, const char *action) case EEXIST: giterr_set(GITERR_OS, "Failed %s - '%s' already exists", action, path); return GIT_EEXISTS; - + default: giterr_set(GITERR_OS, "Could not %s '%s'", action, path); - return GIT_EUNREADABLE; + return -1; } } @@ -1110,6 +1110,13 @@ int git_path_dirload_with_stat( git_vector_remove(contents, i--); continue; } + /* Treat the file as unreadable if we get any other error */ + if (error != 0) { + giterr_clear(); + error = 0; + ps->st.st_mode = GIT_FILEMODE_UNREADABLE; + continue; + } break; } |