]> git.ipfire.org Git - thirdparty/git.git/commitdiff
expand_user_path(): clarify the role of the `real_home` parameter
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Sat, 24 Jul 2021 22:06:51 +0000 (22:06 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 26 Jul 2021 19:17:16 +0000 (12:17 -0700)
The `real_home` parameter only has an effect when expanding paths
starting with `~/`, not when expanding paths starting with `~<user>/`.
Let's make that clear.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
path.c

diff --git a/path.c b/path.c
index 3318ad24336ad18b59be91f3d596edae378d37f9..bf329e535cfddf92728a2d23e4c6d7b229a8b884 100644 (file)
--- a/path.c
+++ b/path.c
@@ -722,7 +722,7 @@ static struct passwd *getpw_str(const char *username, size_t len)
  * Return a string with ~ and ~user expanded via getpw*. Returns NULL on getpw
  * failure or if path is NULL.
  *
- * If real_home is true, strbuf_realpath($HOME) is used in the expansion.
+ * If real_home is true, strbuf_realpath($HOME) is used in the `~/` expansion.
  */
 char *expand_user_path(const char *path, int real_home)
 {