diff options
| author | Russell Belfer <rb@github.com> | 2012-08-24 14:32:45 -0700 |
|---|---|---|
| committer | Russell Belfer <rb@github.com> | 2012-08-24 14:32:45 -0700 |
| commit | 7fbca880aa5c011257ef734d0b5bfd5545dbaf6b (patch) | |
| tree | 4013deca09f158930284631d89bcbfb379f6f879 /src/config.c | |
| parent | 07c06f7a83640e11d6be13a87f02e986ecc6e4b3 (diff) | |
| download | libgit2-7fbca880aa5c011257ef734d0b5bfd5545dbaf6b.tar.gz | |
Support new config locations
As of git v1.7.12, $HOME/.config/git/ is supported as a new
location for "config", "attributes", and "ignore" files.
Diffstat (limited to 'src/config.c')
| -rw-r--r-- | src/config.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/config.c b/src/config.c index 277daaafe..e62dccf51 100644 --- a/src/config.c +++ b/src/config.c @@ -449,7 +449,12 @@ int git_config_set_multivar(git_config *cfg, const char *name, const char *regex int git_config_find_global_r(git_buf *path) { - return git_futils_find_global_file(path, GIT_CONFIG_FILENAME); + int error = git_futils_find_global_file(path, GIT_CONFIG_FILENAME); + + if (error == GIT_ENOTFOUND) + error = git_futils_find_global_file(path, GIT_CONFIG_FILENAME_ALT); + + return error; } int git_config_find_global(char *global_config_path, size_t length) |
