Merge branch 'jn/warn-on-inaccessible-loosen' into maint
When attempting to read the XDG-style $HOME/.config/git/config and finding that $HOME/.config/git is a file, we gave a wrong error message, instead of treating the case as "a custom config file does not exist there" and moving on. * jn/warn-on-inaccessible-loosen: config: exit on error accessing any config file doc: advertise GIT_CONFIG_NOSYSTEM config: treat user and xdg config permission problems as errors config, gitignore: failure to access with ENOTDIR is ok
This commit is contained in:
10
config.c
10
config.c
@ -58,7 +58,7 @@ static int handle_path_include(const char *path, struct config_include_data *inc
|
||||
path = buf.buf;
|
||||
}
|
||||
|
||||
if (!access_or_warn(path, R_OK)) {
|
||||
if (!access_or_die(path, R_OK)) {
|
||||
if (++inc->depth > MAX_INCLUDE_DEPTH)
|
||||
die(include_depth_advice, MAX_INCLUDE_DEPTH, path,
|
||||
cf && cf->name ? cf->name : "the command line");
|
||||
@ -938,23 +938,23 @@ int git_config_early(config_fn_t fn, void *data, const char *repo_config)
|
||||
|
||||
home_config_paths(&user_config, &xdg_config, "config");
|
||||
|
||||
if (git_config_system() && !access_or_warn(git_etc_gitconfig(), R_OK)) {
|
||||
if (git_config_system() && !access_or_die(git_etc_gitconfig(), R_OK)) {
|
||||
ret += git_config_from_file(fn, git_etc_gitconfig(),
|
||||
data);
|
||||
found += 1;
|
||||
}
|
||||
|
||||
if (xdg_config && !access_or_warn(xdg_config, R_OK)) {
|
||||
if (xdg_config && !access_or_die(xdg_config, R_OK)) {
|
||||
ret += git_config_from_file(fn, xdg_config, data);
|
||||
found += 1;
|
||||
}
|
||||
|
||||
if (user_config && !access_or_warn(user_config, R_OK)) {
|
||||
if (user_config && !access_or_die(user_config, R_OK)) {
|
||||
ret += git_config_from_file(fn, user_config, data);
|
||||
found += 1;
|
||||
}
|
||||
|
||||
if (repo_config && !access_or_warn(repo_config, R_OK)) {
|
||||
if (repo_config && !access_or_die(repo_config, R_OK)) {
|
||||
ret += git_config_from_file(fn, repo_config, data);
|
||||
found += 1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user