From 098977b0d9a7bc98b1c73f9d78009c3558075687 Mon Sep 17 00:00:00 2001 From: Michael Haggerty Date: Mon, 17 Oct 2011 09:39:10 +0200 Subject: [PATCH] cache.h: add comments for git_path() and git_path_submodule() Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- cache.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/cache.h b/cache.h index e39e160018..99a79d755e 100644 --- a/cache.h +++ b/cache.h @@ -660,7 +660,25 @@ extern char *git_pathdup(const char *fmt, ...) /* Return a statically allocated filename matching the sha1 signature */ extern char *mkpath(const char *fmt, ...) __attribute__((format (printf, 1, 2))); + +/* + * Return the path of a file within get_git_dir(). The arguments + * should be printf-like arguments that produce the filename relative + * to get_git_dir(). Return the resulting path, or "/bad-path/" if + * there is an error. The return value is a pointer into a temporary + * buffer that will be overwritten without notice. + */ extern char *git_path(const char *fmt, ...) __attribute__((format (printf, 1, 2))); + +/* + * Return the path of a file within the git_dir of the submodule + * located at path. The other arguments should be printf-like + * arguments that produce the filename relative to "/.git". If + * "/.git" is a gitlink file, follow it to find the actual + * submodule git_dir. Return the resulting path, or "/bad-path/" if + * there is an error. The return value is a pointer into a temporary + * buffer that will be overwritten without notice. + */ extern char *git_path_submodule(const char *path, const char *fmt, ...) __attribute__((format (printf, 2, 3)));