diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2015-10-20 17:42:42 +0200 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2015-10-21 15:11:18 +0200 |
commit | 8c7c5fa585c6a63dc8186febd6e032880655e85e (patch) | |
tree | 4fcfb2caf1ef82127605f03b2073ac4e75a561c8 /include/git2 | |
parent | 4280fabb9f79df6c4d95b1f08b97a03874b167eb (diff) | |
download | libgit2-cmn/programdata-config.tar.gz |
config: add a ProgramData levelcmn/programdata-config
This is where portable git stores the global configuration which we can
use to adhere to it even though git isn't quite installed on the system.
Diffstat (limited to 'include/git2')
-rw-r--r-- | include/git2/config.h | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/include/git2/config.h b/include/git2/config.h index 56b5431ac..d0f1ba1b3 100644 --- a/include/git2/config.h +++ b/include/git2/config.h @@ -29,25 +29,28 @@ GIT_BEGIN_DECL * priority levels as well. */ typedef enum { + /** System-wide on Windows, for compatibility with portable git */ + GIT_CONFIG_LEVEL_PROGRAMDATA = 1, + /** System-wide configuration file; /etc/gitconfig on Linux systems */ - GIT_CONFIG_LEVEL_SYSTEM = 1, + GIT_CONFIG_LEVEL_SYSTEM = 2, /** XDG compatible configuration file; typically ~/.config/git/config */ - GIT_CONFIG_LEVEL_XDG = 2, + GIT_CONFIG_LEVEL_XDG = 3, /** User-specific configuration file (also called Global configuration * file); typically ~/.gitconfig */ - GIT_CONFIG_LEVEL_GLOBAL = 3, + GIT_CONFIG_LEVEL_GLOBAL = 4, /** Repository specific configuration file; $WORK_DIR/.git/config on * non-bare repos */ - GIT_CONFIG_LEVEL_LOCAL = 4, + GIT_CONFIG_LEVEL_LOCAL = 5, /** Application specific configuration file; freely defined by applications */ - GIT_CONFIG_LEVEL_APP = 5, + GIT_CONFIG_LEVEL_APP = 6, /** Represents the highest level available config file (i.e. the most * specific config file available that actually is loaded) @@ -142,6 +145,17 @@ GIT_EXTERN(int) git_config_find_xdg(git_buf *out); GIT_EXTERN(int) git_config_find_system(git_buf *out); /** + * Locate the path to the configuration file in ProgramData + * + * Look for the file in %PROGRAMDATA%\Git\config used by portable git. + * + * @param out Pointer to a user-allocated git_buf in which to store the path + * @return 0 if a ProgramData configuration file has been + * found. Its path will be stored in `out`. + */ +GIT_EXTERN(int) git_config_find_programdata(git_buf *out); + +/** * Open the global, XDG and system configuration files * * Utility wrapper that finds the global, XDG and system configuration files |