Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-08-25 01:32:38 +0300
committerJunio C Hamano <gitster@pobox.com>2021-08-25 01:32:38 +0300
commitaab0eeaba56e87f4d471b8e2aba9a648e5606d01 (patch)
treebbc00ea37f54ff6005fa6b909a87e81fc85ed062 /config.c
parentf19b2752e7788ad3a66812fd37fc482fc247eb4c (diff)
parent7ed37eb8ae485ff5590c656e871d6c739edfa067 (diff)
Merge branch 'js/expand-runtime-prefix'
Pathname expansion (like "~username/") learned a way to specify a location relative to Git installation (e.g. its $sharedir which is $(prefix)/share), with "%(prefix)". * js/expand-runtime-prefix: expand_user_path: allow in-flight topics to keep using the old name interpolate_path(): allow specifying paths relative to the runtime prefix Use a better name for the function interpolating paths expand_user_path(): clarify the role of the `real_home` parameter expand_user_path(): remove stale part of the comment tests: exercise the RUNTIME_PREFIX feature
Diffstat (limited to 'config.c')
-rw-r--r--config.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/config.c b/config.c
index f33abeab85..cb4a8058bf 100644
--- a/config.c
+++ b/config.c
@@ -137,7 +137,7 @@ static int handle_path_include(const char *path, struct config_include_data *inc
if (!path)
return config_error_nonbool("include.path");
- expanded = expand_user_path(path, 0);
+ expanded = interpolate_path(path, 0);
if (!expanded)
return error(_("could not expand include path '%s'"), path);
path = expanded;
@@ -185,7 +185,7 @@ static int prepare_include_condition_pattern(struct strbuf *pat)
char *expanded;
int prefix = 0;
- expanded = expand_user_path(pat->buf, 1);
+ expanded = interpolate_path(pat->buf, 1);
if (expanded) {
strbuf_reset(pat);
strbuf_addstr(pat, expanded);
@@ -1270,7 +1270,7 @@ int git_config_pathname(const char **dest, const char *var, const char *value)
{
if (!value)
return config_error_nonbool(var);
- *dest = expand_user_path(value, 0);
+ *dest = interpolate_path(value, 0);
if (!*dest)
die(_("failed to expand user dir in: '%s'"), value);
return 0;
@@ -1845,7 +1845,7 @@ void git_global_config(char **user_out, char **xdg_out)
char *xdg_config = NULL;
if (!user_config) {
- user_config = expand_user_path("~/.gitconfig", 0);
+ user_config = interpolate_path("~/.gitconfig", 0);
xdg_config = xdg_config_home("config");
}