diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2017-04-05 12:24:38 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-04-15 08:51:38 +0200 |
commit | 4aad2f1627bb74948874c0f31e8ce256bf236aa6 (patch) | |
tree | de6b04a3b94f2d709971e878375168120e4fa359 /builtin | |
parent | config: add conditional include (diff) | |
download | git-4aad2f1627bb74948874c0f31e8ce256bf236aa6.tar.xz git-4aad2f1627bb74948874c0f31e8ce256bf236aa6.zip |
path.c: and an option to call real_path() in expand_user_path()
In the next patch we need the ability to expand '~' to
real_path($HOME). But we can't do that from outside because '~' is part
of a pattern, not a true path. Add an option to expand_user_path() to do
so.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/commit.c | 2 | ||||
-rw-r--r-- | builtin/config.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/builtin/commit.c b/builtin/commit.c index 2de5f6cc64..4b0fc0eae1 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -1404,7 +1404,7 @@ int cmd_status(int argc, const char **argv, const char *prefix) static const char *implicit_ident_advice(void) { - char *user_config = expand_user_path("~/.gitconfig"); + char *user_config = expand_user_path("~/.gitconfig", 0); char *xdg_config = xdg_config_home("config"); int config_exists = file_exists(user_config) || file_exists(xdg_config); diff --git a/builtin/config.c b/builtin/config.c index 05843a0f96..70bfaaaa1d 100644 --- a/builtin/config.c +++ b/builtin/config.c @@ -502,7 +502,7 @@ int cmd_config(int argc, const char **argv, const char *prefix) } if (use_global_config) { - char *user_config = expand_user_path("~/.gitconfig"); + char *user_config = expand_user_path("~/.gitconfig", 0); char *xdg_config = xdg_config_home("config"); if (!user_config) |