diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-01-11 16:47:07 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-01-11 16:47:07 -0800 |
commit | e6f1550aa569fa5773977bc2c83729f29031b39e (patch) | |
tree | b7eb87650d0733bacd92214ee5937a27a06cf9c6 /wrapper.c | |
parent | 22fd1c84100b4c26328a8ad0c044cce2aaf8e130 (diff) | |
parent | 8f2bbe452e2c2917ec3c9a5d1593f26908cab83b (diff) | |
download | git-e6f1550aa569fa5773977bc2c83729f29031b39e.tar.gz |
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
Diffstat (limited to 'wrapper.c')
-rw-r--r-- | wrapper.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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; |