summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2017-03-20 21:21:27 -0400
committerJunio C Hamano <gitster@pobox.com>2017-03-21 11:12:52 -0700
commit598019769cbaa38495b0c04297efa13d0f4a572e (patch)
tree2755340618d02a7027fe54f25a875e7caccaddc4 /cache.h
parenta1be47e4ca65718ec239e4b86a44e45220237aee (diff)
downloadgit-598019769cbaa38495b0c04297efa13d0f4a572e.tar.gz
prefix_filename: move docstring to header file
This is a public function, so we should make its documentation available near the declaration. While we're at it, we can give a few details about how it works. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index 9b2157f591..a01668fc42 100644
--- a/cache.h
+++ b/cache.h
@@ -529,7 +529,19 @@ extern const char *setup_git_directory_gently(int *);
extern const char *setup_git_directory(void);
extern char *prefix_path(const char *prefix, int len, const char *path);
extern char *prefix_path_gently(const char *prefix, int len, int *remaining, const char *path);
+
+/*
+ * Concatenate "prefix" (if len is non-zero) and "path", with no
+ * connecting characters (so "prefix" should end with a "/").
+ * Unlike prefix_path, this should be used if the named file does
+ * not have to interact with index entry; i.e. name of a random file
+ * on the filesystem.
+ *
+ * The return value may point to static storage which will be overwritten by
+ * further calls.
+ */
extern const char *prefix_filename(const char *prefix, int len, const char *path);
+
extern int check_filename(const char *prefix, const char *name);
extern void verify_filename(const char *prefix,
const char *name,