[PATCH 1/1] git-config: git-config --list fixed when GIT_CONFIG value starts with ~/

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When we execute git config --list and $GIT_CONFIG value starts with home
prefix - ~/ it produces folowing error - fatal: unable to read config
file '~/.gitconfig': No such file or directory. This patch fixed it with
expand_user_path for configuration file path before git-config --list
call.

Signed-off-by: Alex Kuleshov <kuleshovmail@xxxxxxxxx>
Signed-off-by: 0xAX <kuleshovmail@xxxxxxxxx>
---
 builtin/config.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/builtin/config.c b/builtin/config.c
index 7bba516..df1bee0 100644
--- a/builtin/config.c
+++ b/builtin/config.c
@@ -540,6 +540,8 @@ int cmd_config(int argc, const char **argv, const char *prefix)
 
 	if (actions == ACTION_LIST) {
 		check_argc(argc, 0, 0);
+		const char* newpath = expand_user_path(given_config_source.file);
+		given_config_source.file = newpath;
 		if (git_config_with_options(show_all_config, NULL,
 					    &given_config_source,
 					    respect_includes) < 0) {
-- 
2.1.3.17.g7fa1365.dirty

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]