path.c: group git_path(), git_pathdup() and strbuf_git_path() together
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Sun, 30 Nov 2014 08:24:30 +0000 (15:24 +0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 1 Dec 2014 19:00:11 +0000 (11:00 -0800)
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
path.c
diff --git a/path.c b/path.c
index 6991103d436ef61dfecb2a35c8ea0422ce622e77..df0f75ba4fd6762368a3ee26f3089bf581d58158 100644 (file)
--- a/path.c
+++ b/path.c
@@ -78,6 +78,16 @@ void strbuf_git_path(struct strbuf *sb, const char *fmt, ...)
        va_end(args);
 }
 
+const char *git_path(const char *fmt, ...)
+{
+       struct strbuf *pathname = get_pathname();
+       va_list args;
+       va_start(args, fmt);
+       do_git_path(pathname, fmt, args);
+       va_end(args);
+       return pathname->buf;
+}
+
 char *git_pathdup(const char *fmt, ...)
 {
        struct strbuf path = STRBUF_INIT;
@@ -109,16 +119,6 @@ const char *mkpath(const char *fmt, ...)
        return cleanup_path(pathname->buf);
 }
 
-const char *git_path(const char *fmt, ...)
-{
-       struct strbuf *pathname = get_pathname();
-       va_list args;
-       va_start(args, fmt);
-       do_git_path(pathname, fmt, args);
-       va_end(args);
-       return pathname->buf;
-}
-
 void home_config_paths(char **global, char **xdg, char *file)
 {
        char *xdg_home = getenv("XDG_CONFIG_HOME");