Expand ~ and ~user in core.excludesfile, commit.template

These config variables are parsed to substitute ~ and ~user with getpw
entries.

user_path() refactored into new function expand_user_path(), to allow
dynamically allocating the return buffer.

Original patch by Karl Chen, modified by Matthieu Moy, and further
amended by Junio C Hamano.

Signed-off-by: Karl Chen <quarl@quarl.org>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Matthieu Moy
2009-11-17 18:24:25 +01:00
committed by Junio C Hamano
parent 78d553b7d7
commit 395de250d9
5 changed files with 63 additions and 37 deletions

View File

@ -954,7 +954,7 @@ static int git_commit_config(const char *k, const char *v, void *cb)
struct wt_status *s = cb;
if (!strcmp(k, "commit.template"))
return git_config_string(&template_file, k, v);
return git_config_pathname(&template_file, k, v);
return git_status_config(k, v, s);
}