git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] git-config: git-config --list fixed when GIT_CONFIG value starts with ~/
@ 2014-11-14 18:29 0xAX
  2014-11-14 19:19 ` Eric Sunshine
  2014-11-14 20:10 ` Junio C Hamano
  0 siblings, 2 replies; 6+ messages in thread
From: 0xAX @ 2014-11-14 18:29 UTC (permalink / raw)
  To: git@vger.kernel.org; +Cc: 0xAX, Alex Kuleshov

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@gmial.com>
Signed-off-by: 0xAX <kuleshovmail@gmail.com>
---
 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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-11-14 20:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-14 18:29 [PATCH 1/1] git-config: git-config --list fixed when GIT_CONFIG value starts with ~/ 0xAX
2014-11-14 19:19 ` Eric Sunshine
2014-11-14 19:30   ` Jeff King
2014-11-14 19:38     ` Alex Kuleshov
2014-11-14 20:04       ` Jeff King
2014-11-14 20:10 ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).