diff options
| author | Edward Thomson <ethomson@edwardthomson.com> | 2015-10-21 13:43:22 -0700 |
|---|---|---|
| committer | Edward Thomson <ethomson@edwardthomson.com> | 2015-10-21 13:43:22 -0700 |
| commit | 44b1e3e390c85199186d6178bd942bf9e7c4bef1 (patch) | |
| tree | 4ba8df690b30cc4d4176a7861fca1a6f69d6e4cd /include/git2 | |
| parent | f555f7cd7068c1788f050666c0641a884967b12d (diff) | |
| parent | 8c7c5fa585c6a63dc8186febd6e032880655e85e (diff) | |
| download | libgit2-44b1e3e390c85199186d6178bd942bf9e7c4bef1.tar.gz | |
Merge pull request #3475 from libgit2/cmn/programdata-config
config: add a ProgramData level
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 |
