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
wrapper.c
10
wrapper.c
@ -411,11 +411,19 @@ void warn_on_inaccessible(const char *path)
|
||||
int access_or_warn(const char *path, int mode)
|
||||
{
|
||||
int ret = access(path, mode);
|
||||
if (ret && errno != ENOENT)
|
||||
if (ret && errno != ENOENT && errno != ENOTDIR)
|
||||
warn_on_inaccessible(path);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int access_or_die(const char *path, int mode)
|
||||
{
|
||||
int ret = access(path, mode);
|
||||
if (ret && errno != ENOENT && errno != ENOTDIR)
|
||||
die_errno(_("unable to access '%s'"), path);
|
||||
return ret;
|
||||
}
|
||||
|
||||
struct passwd *xgetpwuid_self(void)
|
||||
{
|
||||
struct passwd *pw;
|
||||
|
Reference in New Issue
Block a user