diff options
Diffstat (limited to 'src/config_file.c')
-rw-r--r-- | src/config_file.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/config_file.c b/src/config_file.c index 093e74a70..d72e12c56 100644 --- a/src/config_file.c +++ b/src/config_file.c @@ -1269,7 +1269,7 @@ static int config_parse(git_strmap *values, diskfile_backend *cfg_file, struct r if ((result = git_path_dirname_r(&path, reader->file_path)) < 0) break; - /* We need to know out index in the array, as the next config_parse call may realloc */ + /* We need to know our index in the array, as the next config_parse call may realloc */ index = git_array_size(cfg_file->readers) - 1; dir = git_buf_detach(&path); result = included_path(&path, dir, var->entry->value); @@ -1280,12 +1280,18 @@ static int config_parse(git_strmap *values, diskfile_backend *cfg_file, struct r r->file_path = git_buf_detach(&path); git_buf_init(&r->buffer, 0); - if ((result = git_futils_readbuffer_updated(&r->buffer, r->file_path, &r->file_mtime, - &r->file_size, NULL)) < 0) - break; + result = git_futils_readbuffer_updated(&r->buffer, r->file_path, &r->file_mtime, + &r->file_size, NULL); + + if (result == 0) { + result = config_parse(values, cfg_file, r, level, depth+1); + r = git_array_get(cfg_file->readers, index); + } + else if (result == GIT_ENOTFOUND) { + giterr_clear(); + result = 0; + } - result = config_parse(values, cfg_file, r, level, depth+1); - r = git_array_get(cfg_file->readers, index); git_buf_free(&r->buffer); if (result < 0) |