summaryrefslogtreecommitdiff
path: root/include/git2
diff options
context:
space:
mode:
authorVicent Martí <vicent@github.com>2013-05-07 15:09:11 -0700
committerVicent Martí <vicent@github.com>2013-05-07 15:09:11 -0700
commitaf795759a7c1e753d440e3c3ca4dd5d8e391018c (patch)
treeb9159ff8fbc97b5bbaab5c2d319f35ac82890819 /include/git2
parentd6465e1a7df00f5a93c43b2def129ecd6473f5d1 (diff)
parent5d8318875fc7234d00140ce1f18b67bc4703e5f4 (diff)
downloadlibgit2-af795759a7c1e753d440e3c3ca4dd5d8e391018c.tar.gz
Merge pull request #1552 from carlosmn/config-helpers
Config helpers for global/xdg config files
Diffstat (limited to 'include/git2')
-rw-r--r--include/git2/config.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/git2/config.h b/include/git2/config.h
index 5a2f956fd..724788ae0 100644
--- a/include/git2/config.h
+++ b/include/git2/config.h
@@ -195,6 +195,21 @@ GIT_EXTERN(int) git_config_open_level(
unsigned int level);
/**
+ * Open the global/XDG configuration file according to git's rules
+ *
+ * Git allows you to store your global configuration at
+ * `$HOME/.config` or `$XDG_CONFIG_HOME/git/config`. For backwards
+ * compatability, the XDG file shouldn't be used unless the use has
+ * created it explicitly. With this function you'll open the correct
+ * one to write to.
+ *
+ * @param out pointer in which to store the config object
+ * @param config the config object in which to look
+ */
+GIT_EXTERN(int) git_config_open_global(git_config **out, git_config *config);
+
+
+/**
* Reload changed config files
*
* A config file may be changed on disk out from under the in-memory