Skip to content

Commit 57a23b7

Browse files
pcloudsgitster
authored andcommitted
path.c: group git_path(), git_pathdup() and strbuf_git_path() together
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 8afdaf3 commit 57a23b7

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

path.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,16 @@ void strbuf_git_path(struct strbuf *sb, const char *fmt, ...)
7878
va_end(args);
7979
}
8080

81+
const char *git_path(const char *fmt, ...)
82+
{
83+
struct strbuf *pathname = get_pathname();
84+
va_list args;
85+
va_start(args, fmt);
86+
do_git_path(pathname, fmt, args);
87+
va_end(args);
88+
return pathname->buf;
89+
}
90+
8191
char *git_pathdup(const char *fmt, ...)
8292
{
8393
struct strbuf path = STRBUF_INIT;
@@ -109,16 +119,6 @@ const char *mkpath(const char *fmt, ...)
109119
return cleanup_path(pathname->buf);
110120
}
111121

112-
const char *git_path(const char *fmt, ...)
113-
{
114-
struct strbuf *pathname = get_pathname();
115-
va_list args;
116-
va_start(args, fmt);
117-
do_git_path(pathname, fmt, args);
118-
va_end(args);
119-
return pathname->buf;
120-
}
121-
122122
void home_config_paths(char **global, char **xdg, char *file)
123123
{
124124
char *xdg_home = getenv("XDG_CONFIG_HOME");

0 commit comments

Comments
 (0)