summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-11-22 16:28:38 -0800
committerJunio C Hamano <gitster@pobox.com>2009-11-22 16:28:38 -0800
commiteb2fc8f899a58eedc87e7e8ea0fdecdc2ba9f430 (patch)
tree63d327f46a8c9d112e40efbaf85fe85a10f5530b /config.c
parent3fa384d27e79d4731a9188716f566fa423a8ff50 (diff)
parent0f7fb21a7aec7ab8047536af018daa981b3b2676 (diff)
downloadgit-eb2fc8f899a58eedc87e7e8ea0fdecdc2ba9f430.tar.gz
Merge branch 'mm/config-pathname-tilde-expand'
* mm/config-pathname-tilde-expand: Documentation: avoid xmlto input error expand_user_path: expand ~ to $HOME, not to the actual homedir. Expand ~ and ~user in core.excludesfile, commit.template
Diffstat (limited to 'config.c')
-rw-r--r--config.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/config.c b/config.c
index 51f22088e7..37385ce9d3 100644
--- a/config.c
+++ b/config.c
@@ -351,6 +351,16 @@ int git_config_string(const char **dest, const char *var, const char *value)
return 0;
}
+int git_config_pathname(const char **dest, const char *var, const char *value)
+{
+ if (!value)
+ return config_error_nonbool(var);
+ *dest = expand_user_path(value);
+ if (!*dest)
+ die("Failed to expand user dir in: '%s'", value);
+ return 0;
+}
+
static int git_default_core_config(const char *var, const char *value)
{
/* This needs a better name */
@@ -479,7 +489,7 @@ static int git_default_core_config(const char *var, const char *value)
return git_config_string(&editor_program, var, value);
if (!strcmp(var, "core.excludesfile"))
- return git_config_string(&excludes_file, var, value);
+ return git_config_pathname(&excludes_file, var, value);
if (!strcmp(var, "core.whitespace")) {
if (!value)