summaryrefslogtreecommitdiff
path: root/include/git2/config.h
diff options
context:
space:
mode:
authorSven Strickroth <email@cs-ware.de>2012-09-24 18:59:00 +0200
committerSven Strickroth <email@cs-ware.de>2012-09-24 18:59:00 +0200
commit8b4f9b17580c52ac2b1f2f42f5c53116fb763436 (patch)
tree1f23fd905408276cd436957e11db401f1f93ad05 /include/git2/config.h
parent6605f51d81a9ccfb1b5a1c1689a57cf3f5b2f5b3 (diff)
downloadlibgit2-8b4f9b17580c52ac2b1f2f42f5c53116fb763436.tar.gz
Correctly read xdr compatible %HOME%/.config/git/config config file
This file is not just read if the global config file (%HOME%/.gitconfig) is not found, however, it is used everytime but with lower priority. Signed-off-by: Sven Strickroth <email@cs-ware.de>
Diffstat (limited to 'include/git2/config.h')
-rw-r--r--include/git2/config.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/git2/config.h b/include/git2/config.h
index 21d8a0b05..a3202c2b1 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 xdr 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 xdr compatible configuration file
+ *
+ * The xdr 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
+ * global configuration file.
+ *
+ * @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`.
+ */
+GIT_EXTERN(int) git_config_find_xdr(char *global_config_path, size_t length);
+
+/**
* Locate the path to the system configuration file
*
* If /etc/gitconfig doesn't exist, it will look for