summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2009-12-03 13:51:36 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2009-12-03 13:51:36 -0800
commitd1dfc016d868322638c87a23a624651874a107c2 (patch)
treecc2a7e259b875f5c0e72ddd26c4a430ae2b8b008 /config.c
parentMerge branch 'bc/grep-i-F' into maint (diff)
parentDocumentation: avoid xmlto input error (diff)
downloadtgif-d1dfc016d868322638c87a23a624651874a107c2.tar.xz
Merge branch 'mm/config-pathname-tilde-expand' into maint
* 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 c644061136..b3d1ff4e7c 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 */
@@ -474,7 +484,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)