diff options
| author | Vicent Martà <vicent@github.com> | 2012-10-16 08:36:55 -0700 |
|---|---|---|
| committer | Vicent Martà <vicent@github.com> | 2012-10-16 08:36:55 -0700 |
| commit | 52748f7b9f039b94e212c41d8a4f46b50b917962 (patch) | |
| tree | af95f6f22dc75f72f5520339c38c8a9c5a9ef3e5 /include/git2 | |
| parent | 9e37305aad734efb83f22b2e292a7591bbf49f15 (diff) | |
| parent | 997579bed1806f217c910da05092ffdf9f4523b4 (diff) | |
| download | libgit2-52748f7b9f039b94e212c41d8a4f46b50b917962.tar.gz | |
Merge pull request #952 from csware/config-locations
Config location fixes
Diffstat (limited to 'include/git2')
| -rw-r--r-- | include/git2/config.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/git2/config.h b/include/git2/config.h index 21d8a0b05..a7d897443 100644 --- a/include/git2/config.h +++ b/include/git2/config.h @@ -61,6 +61,9 @@ typedef struct { * may be used on any `git_config` call to load the * global configuration file. * + * This method will not guess the path to the xdg compatible + * config file (.config/git/config). + * * @param global_config_path Buffer of GIT_PATH_MAX length to store the path * @return 0 if a global configuration file has been * found. Its path will be stored in `buffer`. @@ -68,6 +71,23 @@ typedef struct { GIT_EXTERN(int) git_config_find_global(char *global_config_path, size_t length); /** + * Locate the path to the global xdg compatible configuration file + * + * The xdg compatible configuration file is usually + * located in `$HOME/.config/git/config`. + * + * This method will try to guess the full path to that + * file, if the file exists. The returned path + * may be used on any `git_config` call to load the + * xdg compatible configuration file. + * + * @param xdg_config_path Buffer of GIT_PATH_MAX length to store the path + * @return 0 if a xdg compatible configuration file has been + * found. Its path will be stored in `buffer`. + */ +GIT_EXTERN(int) git_config_find_xdg(char *xdg_config_path, size_t length); + +/** * Locate the path to the system configuration file * * If /etc/gitconfig doesn't exist, it will look for |
