summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2014-11-30 08:24:28 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-12-01 19:00:11 (GMT)
commit1a83c240f2fe7a0caa94009f066d15fa677d32cd (patch)
treec402a9e78d6130038fdcde0df3b984c577e9ba9b /cache.h
parentdcf692625ac569fefbe52269061230f4fde10e47 (diff)
downloadgit-1a83c240f2fe7a0caa94009f066d15fa677d32cd.zip
git-1a83c240f2fe7a0caa94009f066d15fa677d32cd.tar.gz
git-1a83c240f2fe7a0caa94009f066d15fa677d32cd.tar.bz2
git_snpath(): retire and replace with strbuf_git_path()
In the previous patch, git_snpath() is modified to allocate a new strbuf buffer because vsnpath() needs that. But that makes it awkward because git_snpath() receives a pre-allocated buffer from outside and has to copy data back. Rename it to strbuf_git_path() and make it receive strbuf directly. Using git_path() in update_refs_for_switch() which used to call git_snpath() is safe because that function and all of its callers do not keep any pointer to the round-robin buffer pool allocated by get_pathname(). Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/cache.h b/cache.h
index dbee0a3..56643cf 100644
--- a/cache.h
+++ b/cache.h
@@ -679,8 +679,8 @@ extern int check_repository_format(void);
extern char *mksnpath(char *buf, size_t n, const char *fmt, ...)
__attribute__((format (printf, 3, 4)));
-extern char *git_snpath(char *buf, size_t n, const char *fmt, ...)
- __attribute__((format (printf, 3, 4)));
+extern void strbuf_git_path(struct strbuf *sb, const char *fmt, ...)
+ __attribute__((format (printf, 2, 3)));
extern char *git_pathdup(const char *fmt, ...)
__attribute__((format (printf, 1, 2)));
extern char *mkpathdup(const char *fmt, ...)