Files
git/builtin
Matheus Tavares a185dd58ec init: fix bug regarding ~/ expansion in init.templateDir
We used to read the init.templateDir setting at builtin/init-db.c using
a git_config() callback that, in turn, called git_config_pathname(). To
simplify the config reading logic at this file and plug a memory leak,
this was replaced by a direct call to git_config_get_value() at
e4de4502e6 ("init: remove git_init_db_config() while fixing leaks",
2021-03-14). However, this function doesn't provide path expanding
semantics, like git_config_pathname() does, so paths with '~/' and
'~user/' are treated literally. This makes 'git init' fail to handle
init.templateDir paths using these constructs:

	$ git config init.templateDir '~/templates_dir'
	$ git init
	'warning: templates not found in ~/templates_dir'

Replace the git_config_get_value() call by git_config_get_pathname(),
which does the '~/' and '~user/' expansions. Also add a regression test.
Note that unlike git_config_get_value(), the config cache does not own
the memory for the path returned by git_config_get_pathname(), so we
must free() it.

Reported on IRC by rkta.

Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-05-25 13:22:08 +09:00
..
2021-01-06 15:10:49 -08:00
2020-07-30 19:18:06 -07:00
2021-02-25 16:43:29 -08:00
2021-02-05 16:40:45 -08:00
2020-08-11 18:04:11 -07:00
2021-01-06 15:10:49 -08:00
2020-10-16 12:30:45 -07:00
2021-02-25 16:43:30 -08:00
2021-02-25 16:43:30 -08:00
2021-02-25 16:43:30 -08:00
2021-02-25 16:43:30 -08:00
2021-01-06 15:10:49 -08:00
2021-02-17 17:21:40 -08:00
2020-03-24 15:04:43 -07:00
2021-01-05 14:58:29 -08:00
2021-02-25 16:43:31 -08:00
2021-02-22 16:12:43 -08:00
2021-04-28 09:25:44 +09:00
2021-02-05 16:40:44 -08:00
2021-01-06 14:22:24 -08:00
2020-03-24 15:04:44 -07:00
2020-05-13 12:19:18 -07:00
2021-02-25 16:43:33 -08:00
2020-07-30 19:18:06 -07:00
2021-01-25 14:19:19 -08:00
2021-02-25 16:43:32 -08:00
2021-02-25 16:43:32 -08:00
2020-07-30 19:18:06 -07:00
2020-08-11 18:04:11 -07:00
2021-03-14 15:57:59 -07:00