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>

Nguyễn Thái Ngọc Duy committed Nov 30, 2014 at 15:24 UTC 8afdaf39e318711dc05ad52ae6c227eaedf6c7ff
1 file changed +4 -4
path.c
+4 -4
@@ -60,7 +60,7 @@ char *mksnpath(char *buf, size_t n, const char *fmt, ...)
60 return cleanup_path(buf);
61 }
62
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)
64 {
65 const char *git_dir = get_git_dir();
66 strbuf_addstr(buf, git_dir);
@@ -74,7 +74,7 @@ void strbuf_git_path(struct strbuf *sb, const char *fmt, ...)
74 {
75 va_list args;
76 va_start(args, fmt);
77 - vsnpath(sb, fmt, args);
77 + do_git_path(sb, fmt, args);
78 va_end(args);
79 }
80
@@ -83,7 +83,7 @@ char *git_pathdup(const char *fmt, ...)
83 struct strbuf path = STRBUF_INIT;
84 va_list args;
85 va_start(args, fmt);
86 - vsnpath(&path, fmt, args);
86 + do_git_path(&path, fmt, args);
87 va_end(args);
88 return strbuf_detach(&path, NULL);
89 }
@@ -114,7 +114,7 @@ const char *git_path(const char *fmt, ...)
114 struct strbuf *pathname = get_pathname();
115 va_list args;
116 va_start(args, fmt);
117 - vsnpath(pathname, fmt, args);
117 + do_git_path(pathname, fmt, args);
118 va_end(args);
119 return pathname->buf;
120 }