summaryrefslogtreecommitdiff
path: root/path.c
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2021-07-24 22:06:52 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-07-26 19:17:16 (GMT)
commita03b097d6307763c6778f5a1f194fbcbd158a5f7 (patch)
tree64e20e92d5b74c31ed5cd324b95545cf220ba12e /path.c
parent644e6b2c0f55fa52de88586d375e03ac7f7914b7 (diff)
downloadgit-a03b097d6307763c6778f5a1f194fbcbd158a5f7.zip
git-a03b097d6307763c6778f5a1f194fbcbd158a5f7.tar.gz
git-a03b097d6307763c6778f5a1f194fbcbd158a5f7.tar.bz2
Use a better name for the function interpolating paths
It is not immediately clear what `expand_user_path()` means, so let's rename it to `interpolate_path()`. This also opens the path for interpolating more than just a home directory. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'path.c')
-rw-r--r--path.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/path.c b/path.c
index bf329e5..8dc5ad2 100644
--- a/path.c
+++ b/path.c
@@ -724,7 +724,7 @@ static struct passwd *getpw_str(const char *username, size_t len)
*
* If real_home is true, strbuf_realpath($HOME) is used in the `~/` expansion.
*/
-char *expand_user_path(const char *path, int real_home)
+char *interpolate_path(const char *path, int real_home)
{
struct strbuf user_path = STRBUF_INIT;
const char *to_copy = path;
@@ -811,7 +811,7 @@ const char *enter_repo(const char *path, int strict)
strbuf_add(&validated_path, path, len);
if (used_path.buf[0] == '~') {
- char *newpath = expand_user_path(used_path.buf, 0);
+ char *newpath = interpolate_path(used_path.buf, 0);
if (!newpath)
return NULL;
strbuf_attach(&used_path, newpath, strlen(newpath),