diff options
| author | Junio C Hamano <gitster@pobox.com> | 2021-08-24 15:32:38 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2021-08-24 15:32:38 -0700 |
| commit | aab0eeaba56e87f4d471b8e2aba9a648e5606d01 (patch) | |
| tree | bbc00ea37f54ff6005fa6b909a87e81fc85ed062 /builtin | |
| parent | f19b2752e7788ad3a66812fd37fc482fc247eb4c (diff) | |
| parent | 7ed37eb8ae485ff5590c656e871d6c739edfa067 (diff) | |
| download | git-aab0eeaba56e87f4d471b8e2aba9a648e5606d01.tar.xz | |
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 'builtin')
| -rw-r--r-- | builtin/credential-cache.c | 2 | ||||
| -rw-r--r-- | builtin/credential-store.c | 2 | ||||
| -rw-r--r-- | builtin/gc.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/builtin/credential-cache.c b/builtin/credential-cache.c index 76a6ba3722..e8a7415747 100644 --- a/builtin/credential-cache.c +++ b/builtin/credential-cache.c @@ -90,7 +90,7 @@ static char *get_socket_path(void) { struct stat sb; char *old_dir, *socket; - old_dir = expand_user_path("~/.git-credential-cache", 0); + old_dir = interpolate_path("~/.git-credential-cache", 0); if (old_dir && !stat(old_dir, &sb) && S_ISDIR(sb.st_mode)) socket = xstrfmt("%s/socket", old_dir); else diff --git a/builtin/credential-store.c b/builtin/credential-store.c index ae3c1ba75f..62a4f3c265 100644 --- a/builtin/credential-store.c +++ b/builtin/credential-store.c @@ -173,7 +173,7 @@ int cmd_credential_store(int argc, const char **argv, const char *prefix) if (file) { string_list_append(&fns, file); } else { - if ((file = expand_user_path("~/.git-credentials", 0))) + if ((file = interpolate_path("~/.git-credentials", 0))) string_list_append_nodup(&fns, file); file = xdg_config_home("credentials"); if (file) diff --git a/builtin/gc.c b/builtin/gc.c index f05d2f0a1a..6ce5ca4512 100644 --- a/builtin/gc.c +++ b/builtin/gc.c @@ -1542,7 +1542,7 @@ static char *launchctl_service_filename(const char *name) struct strbuf filename = STRBUF_INIT; strbuf_addf(&filename, "~/Library/LaunchAgents/%s.plist", name); - expanded = expand_user_path(filename.buf, 1); + expanded = interpolate_path(filename.buf, 1); if (!expanded) die(_("failed to expand path '%s'"), filename.buf); |
