Skip to content

Commit 8afdaf3

Browse files
pcloudsgitster
authored andcommitted
path.c: rename vsnpath() to do_git_path()
The name vsnpath() gives an impression that this is general path handling function. It's not. This is the underlying implementation of git_path(), git_pathdup() and strbuf_git_path() which will prefix $GIT_DIR in the result string. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 1a83c24 commit 8afdaf3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

path.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ char *mksnpath(char *buf, size_t n, const char *fmt, ...)
6060
return cleanup_path(buf);
6161
}
6262

63-
static void vsnpath(struct strbuf *buf, const char *fmt, va_list args)
63+
static void do_git_path(struct strbuf *buf, const char *fmt, va_list args)
6464
{
6565
const char *git_dir = get_git_dir();
6666
strbuf_addstr(buf, git_dir);
@@ -74,7 +74,7 @@ void strbuf_git_path(struct strbuf *sb, const char *fmt, ...)
7474
{
7575
va_list args;
7676
va_start(args, fmt);
77-
vsnpath(sb, fmt, args);
77+
do_git_path(sb, fmt, args);
7878
va_end(args);
7979
}
8080

@@ -83,7 +83,7 @@ char *git_pathdup(const char *fmt, ...)
8383
struct strbuf path = STRBUF_INIT;
8484
va_list args;
8585
va_start(args, fmt);
86-
vsnpath(&path, fmt, args);
86+
do_git_path(&path, fmt, args);
8787
va_end(args);
8888
return strbuf_detach(&path, NULL);
8989
}
@@ -114,7 +114,7 @@ const char *git_path(const char *fmt, ...)
114114
struct strbuf *pathname = get_pathname();
115115
va_list args;
116116
va_start(args, fmt);
117-
vsnpath(pathname, fmt, args);
117+
do_git_path(pathname, fmt, args);
118118
va_end(args);
119119
return pathname->buf;
120120
}

0 commit comments

Comments
 (0)